Mobile app version of vmapp.org
Login or Join
Connie744

: Importance of order of robots meta tag in head I'm using add_action( 'wp_head', 'my_noindex_follow' ); to call a function that inserts a noindex,follow robots meta tag into the head of my search

@Connie744

Posted in: #MetaTags #Wordpress

I'm using add_action( 'wp_head', 'my_noindex_follow' ); to call a function that inserts a noindex,follow robots meta tag into the head of my search results page.

Does the order in which the robots meta tag appears in the head have an effect?

If so, is it possible to specify where in the head content should go?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Connie744

1 Comments

Sorted by latest first Latest Oldest Best

 

@Steve110

Meta tags can go in any order. The order won't cause you any issues unless for some reason you have a massive <head> and search engines give up on reading it all ;) (it'd have to be very big for that though so don't worry)

In regards to the Wordpress action, you can use the priority parameter on this to run your hooked function in a different order. You'll need to experiment a bit as it depends on what else is running (ie what plugins you have that are adding content here), but a lower priority number will run first and a later number will run last. The default is 10.

For example, to run your function as soon as possible:

add_action('wp_head', 'my_function', 1);


You could possibly use 0 or even a negative number there if you really want - I haven't done that before so just test if it works first.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme