-
AuthorPosts
-
June 5, 2015 at 6:22 am #454926
Hey guys,
I have found couple of threads on this, but I can’t figure out how to change the theme’s meta robots settings on a page basis. This will be very useful for having separate metas for ppc and seo pages, for example. For PPC I am interested in having noindex, follow, noarchive, but since I will have multiple different pages for the same keyword(for split testing) I would get penalized for having duplicate content. I also use different links(tracking software) for PPC that I don’t think would work for SEO. I know I can use some SEO plugins, but that just creates duplicate, conflicting metas.
Is anything like this possible?June 7, 2015 at 5:03 am #455576Hi!
Please note that this is not a theme-related question. That being said, as far as i know robots.txt is set per domain, so no, it’s not possible to set robots.txt on a per-page basis.
Regards,
JosueJune 7, 2015 at 5:39 pm #455647Hey Josue,
Thank you for your reply. You guys are awesome and patient, even with not theme related questions ;)
Nevertheless, this is what I am talking about:
<meta name=”robots” content=”index, follow” />
I think this is defined in the theme’s files and I need to take out the index property. There are a lot of plugins that allow you to define different metas on a page basis, such as SEO plugins or add to head plugins. But, if I use one of those, I will have 2 meta robots, one defined by the theme with the index property, and one defined by the plugin with a noindex property. I don’t mind the follow. So, if it is possible, where can I completely remove the function that defines these metas or how can I modify it?
Thanks.
June 7, 2015 at 11:11 pm #455675Hi!
I see, well there’s a filter available for that, you can paste the following on your child theme functions.php (or Functionality if you don’t have one), for example this will remove the meta tag altogether:
add_filter('avf_set_follow', function($meta) { $meta = ""; return $meta; });
Or to target a specific Page:
add_filter('avf_set_follow', function($meta) { if ( is_page( 22 ) ) { $meta = '<meta name="robots" content="index, follow" />' . "\n"; } return $meta; });
Best regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.