Preventing Google from indexing specific categories
Hello,
I need to prevent google from indexing specific categories with all their posts , and I found this code that, obviously, worked for many people. The code needs to be placed into header.php file between <head> and </head> tags. Here's the code <?php if ( is_category('3') || in_category('3') ) { echo '<meta name="robots" content="noindex">'; } However, when I did it, the home page returned an error. It sounds like no other codes are allowed between the two tags in Atahualpa. Is there another way to implement this code? Or, how do I indicate in Atahualpa which categories are noindex? I need to exclude 4 categories with all the posts from being indexed. Or, is there a way to place a meta tag that would prevent Google from indexing specific categories? Thanks a lot for your help. Vince |
look at your code, you are missing something (hint: look at the beginning and the end)
|
Quote:
If it's true, can I still use the correct code by adding it directly to header.php file? Thanks. |
Quote:
Just so that you know I had to change the theme because of the lack of response here, and everything worked out just perfect. This is not the first time I had to change Atahualpa theme specifically because of the support I got here. I used to like Atahualpa but not any more. I will be transitioning all my sites to a different theme, but do let me know when support changes from unfriendly to friendly. |
I'm sorry you feel ignored but the moderators are volunteers. We are not paid to do this so when a paying customer of mine has a job for me I don't look at the forum as often. People who donate to me do get better response.
I gave you all you needed to solve your issue in my first response. I was trying to help you solve your issue. Good luck picking a theme that is as flexible as atahualpa. I will close this thread. If you decide to come back you can reopen it. |
All times are GMT -6. The time now is 05:32 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.