: 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
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?
More posts by @Connie744
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.