0

My Blog posts can break my SEO, as they're not about the themes my website discusses. So how do I avoid this?

1

Add the <meta name="robots" content="noindex"> meta tag within your <head>.

Then look into is_category() to add it specifically to your category pages.

Or alternatively, you can check if $cat_id is available:

$cat_id = get_query_var('cat');

If it is available, then it is a category page.

EDIT Just add it in an IF statement:

if (is_category()){ 
 <meta name="robots" content="noindex">
}

EDIT 2 You can add this code to your category.php file which you can find within your theme's folder. Add it within the <head> tag.

| improve this answer | |
  • Did this answer help you? If so, please accept this as correct answer. You should consider doing this for your other questions as well. – Christine Cooper Aug 15 '14 at 19:37
  • Of course I do that, I just didn't get the time to implement this. So how do I add my Blog category in is_category()? The page you anchored on WP just tells me about the function and that it can be used to know whether a page is displayed or not... – user51433 Aug 16 '14 at 1:43
  • See updated answer... – Christine Cooper Aug 17 '14 at 20:12
  • I add that piece of statement in where exactly? – user51433 Aug 18 '14 at 7:44
  • Updated answer. – Christine Cooper Aug 19 '14 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy