
-
AuthorPosts
-
May 28, 2018 at 10:53 am #963047
Hi Enfold team!
Can you please show me how to remove the “noindex” meta tag on archives, tags and category pages and change them to “index”?
Pages like these have this command line <meta name=”robots” content=”noindex,follow”/>
https://crackerjackmarketing.com/blog/2015/12/
https://crackerjackmarketing.com/blog/tag/twitter-parties/I would like to remove the noindex tag and change it to index for Google.
Thanks!
-
This topic was modified 6 years, 11 months ago by
Archie.
May 28, 2018 at 3:07 pm #963280Hey hackoffseries,
Try adding this
css code in Quick CSS (located in Enfold > General Styling):code at the bottom of functions.php:add_filter('avf_set_follow','avia_set_follow'); function avia_set_follow(){ $meta = '<meta name="robots" content="index, follow" />' . "\n"; return $meta; }
Hope it helps :)
Best regards,
Nikko-
This reply was modified 6 years, 11 months ago by
Nikko.
May 28, 2018 at 6:13 pm #963387Hey Nikko!
Thank you for your response. I added the code you sent, but it seems like the “noindex” command is still there?
view-source:https://crackerjackmarketing.com/blog/tag/social-media/
view-source:https://crackerjackmarketing.com/blog/2011/11/I’ve already purged all cache on the site but still do not see any changes. Please advice.
Thanks! :)
-
This reply was modified 6 years, 11 months ago by
Archie.
May 30, 2018 at 5:04 am #964023Hi hackoffseries,
I apologize for my mistake, it’s not supposed to be in Quick CSS, but at the bottom of functions.php, however it wouldn’t work since you are using Yoast SEO, you can modify it using the plugin settings in yoast, for more information please check this post: https://yoast.com/wordpress/plugins/seo/yoast-seo-robots-meta-configuration/
Hope it helps.Best regards,
NikkoMay 30, 2018 at 6:00 am #964033Thank you for that information Nikko! :)
May 30, 2018 at 5:15 pm #964398Hi hackoffseries,
Glad that we could help :)
Let us know if you need further assistance.Best regards,
NikkoAugust 15, 2018 at 7:43 am #997454Hi,
This code sets everything to Index, tags and archives too. It overides the settings in AIO SEO Plugin.
Is it possible to only set the product categories to index, but keep the archives and tags to noindex?Thanks!
August 15, 2018 at 2:20 pm #997551Hi Opmaxandi,
You can try limiting the code with this function:
https://wordpress.stackexchange.com/questions/306513/use-is-product-category-properlyIf you need further assistance please let us know.
Best regards,
VictoriaAugust 16, 2018 at 11:08 am #997890Hi Victoria,
If I understand this correctly, I should extend Nikko’s Code with:
is_product_category(‘category-slug1′,’category-slug2’)Or should I put it before the code snippet? Sorry I don’t know PHP, so it’s just a guess…
Regards
August 16, 2018 at 10:31 pm #998192Hi,
add_filter('avf_set_follow','avia_set_follow'); function avia_set_follow(){ if is_product_category(‘category-slug1′,’category-slug2’) { $meta = '<meta name="robots" content="index, follow" />' . "\n"; return $meta; } }
It should be something like that :)
Best regards,
BasilisAugust 17, 2018 at 11:47 am #998374Hi Basilis,
I tried that, but it returns an error:
syntax error, unexpected 'is_product_category' (T_STRING), expecting '('
August 17, 2018 at 1:17 pm #998421Hi,
Please use this code instead:
add_filter('avf_set_follow','avia_set_follow_product_cats', 10, 1); function avia_set_follow_product_cats($meta) { if (is_product_category(array( 'shirts', 'games' ))) { $meta = '<meta name="robots" content="index, follow" />' . "\n"; } return $meta; }
and replace shirts and games with your category slugs. You can add more slugs, just separate them with a comma.
Best regards,
DudeAugust 17, 2018 at 5:05 pm #998513Hey Dude!
Seems to be working!
Thanks, you’re a rockstar – I owe you a white russian ;)August 17, 2018 at 5:15 pm #998516Hey!
Great, glad it works now :)
Cheers!
PeterJanuary 26, 2021 at 8:44 pm #1275563Hi,
how can I edit singularly the tag and decide one by one if noindex or follow?
ThanksJanuary 28, 2021 at 9:08 am #1276002Hi Daniele,
Please try the code posted above by Dude, then replace the slug names on this line:
if (is_product_category(array( 'shirts', 'games' )))
with your own slugs.
Best regards,
RikardFebruary 8, 2021 at 5:39 am #1278530thanks Rikard
February 8, 2021 at 5:34 pm #1278724Hi Daniele,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
VictoriaDecember 1, 2022 at 9:37 am #1374575How would this be applied to product tags in woocommerce?
December 1, 2022 at 12:39 pm #1374598Hi hmsvictory,
You should be able to use the is_product_tag conditional instead:
is_product_tag( array( 'shirts', 'games' ) )
https://woocommerce.com/document/conditional-tags/
Best regards,
Rikard -
This topic was modified 6 years, 11 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.