noindex an individual post in wordpress
Posted | archive
Be cautious to prevent fire, theft and ChinaNET police.
Here's how to noindex a single post in wordpress without install any plugin or edit robots.txt
file
- open
http://your-site.com/wp-admin/theme-editor.php
, and choose to edit theheader.php
- add this line after a bunch of
<meta>
tags:
<?php if (in_array($post->ID, array('2323', '2424', '2525'))) {echo '<meta name="robots" content="noindex">';} ; ?>
In the above example we block wordpress posts with id 2323, 2424 and 2525. - Open Google Webmaster tool 1 or 2, and remove your search record &' cache from Google
Comments