Update the metatag in wordpress

426 views Asked by At

Currently I am using Yoast plugin for seo. By default it assigns this meta tag for author page:

<meta name="robots" content="noindex,follow,noodp"/>

How can I update this tag to:

<meta name="robots" content="noindex, nofollow,noodp" />
2

There are 2 answers

4
Akshay Shah On

You can bind to the wp_head hook and overwrite the meta tag by adding the following code to your functions.php file

add_action( 'wp_head', 'insert_in_head', 11 ); 
function insert_in_head(){
 echo '<meta name="robots" content="noindex,follow,noodp1"/>';
}
0
AudioBubble On
  1. Log in to your WordPress website. When you’re logged in, you will be in your ‘Dashboard’. On the left-hand side, you will see a menu. In that menu, click on ‘SEO’.

  2. The ‘SEO’ settings will expand providing you additional options. If you don’t see the ‘Tools’ setting in your ‘SEO’ menu, please enable your advanced settings first. Yoast SEO > Dashboard (Advanced disabled) Menu with advanced settings disabled Enable advanced features

  3. Click on ‘Tools’. Yoast SEO > Tools
  4. Click on ‘File Editor’. This menu will not appear if your WordPress install has disabled file editing. Please enable file editing or edit the file through FTP.

  5. Make the changes to your robots.txt file. If you do not have a robots.txt file, click the button to create it.

Source:

https://kb.yoast.com/kb/how-to-edit-robots-txt-through-yoast-seo/