5

I am using custom post types to add certain sections to my website. These post types are not meant to be treated like a blog, it's basically just an easy way for me to give the client access to managing certain sections, such as "reviews." Today I noticed that Google is indexing these custom post types and I was wondering how I can prevent that.

For instance, "reviews" is one of my custom post types and Google is indexing mywebsite.com/reviews as well as mywebsite.com/reviews/review, which looks terrible because there is no layout for it.

Is there any way to prevent Wordpress from even creating these sections? Thanks!

2 Answers 2

11

If you write code for registering custom post-type try adding these attributes

public => false, has_archive => false, publicly_queryable => false, query_var => false

Otherwise, set these options to false in plugin that you might be using.

1
  • 1
    "publicaly_queryable" should be spelled "publicly_queryable" (no 'a' after 'public')
    – doppler
    Commented Feb 18, 2020 at 15:24
0

Some functionality won't be working after using

publickly_queryable => false, query_var => false

It's enough to stop indexing by the search engines by using only

public => false, has_archive => false

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.