I use a custom post type in one of my sites for image slideshows. I have publicly queryable set to false/off but when Google crawls my site I see 404 errors for the URLs for my slideshows. I thought that by having publicly queryable off WordPress would not create those front end URLs.
How can I completely turn off the front end URLs and pages for my custom post type?
EDIT
By adding 'public' => false
, 'has_archive' => false
, 'publicly_queryable' => false
, and 'query_var' => false
I have successfully gotten rid of the 404 errors in Google. I also added the function provided by @Norcross just for good measure.
Another option would be to set a 301 redirect for all the slideshow CPTs to redirect somewhere (like the home page). This would get picked up by Google, and also make sure no one accidentally gets on them
Apparently your slideshow, not WordPress, it revealing those URLs. I assume it is wrapping the images in the slideshow with links to the custom posts, which you don’t want. You need to edit the slideshow so that it doesn’t do that.
A modification to your original question, you should add
If this is not added, the CPT will show up in search results.
Please Flash or change permalink and save.
Dashboard -> Setting -> permalinks -> Change Or flash Then Save setting.