Skip Navigation

[Resolved] Excluding content from site search results / archive

This thread is resolved. Here is a description of the problem and solution.

Problem:

I just came across this tickbox setting on post type -

exclude_from_search
Whether to exclude posts with this post type from search results.

Would this exclude items from the websites search?

Solution:

The option "exclude_from_search" works for wordpress built-in search page, see document:

https://codex.wordpress.org/Function_Reference/register_post_type#exclude_from_search

Whether to exclude posts with this post type from front end search results.

There isn't such kind of feature to include/exclude in web/google search, you might consider creating your custom robots.txt file:

https://support.google.com/webmasters/answer/6062596?hl=en

Relevant Documentation:

https://codex.wordpress.org/Function_Reference/register_post_type#exclude_from_search

This support ticket is created 6 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by leilaG 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1149986

Following on from closed ticket #1138852

I just came across this tickbox setting on post type -

exclude_from_search
Whether to exclude posts with this post type from search results.

Would this exclude items from the websites search?

We have some content types that we would like to:

Type 1. Exclude from website WordPress search and exclude from web/google search
Type 2. Exclude from website WordPress search and include in web/google search

How do we achieve this?

#1150405

Hi,

The option "exclude_from_search" works for wordpress built-in search page, see document:
https://codex.wordpress.org/Function_Reference/register_post_type#exclude_from_search
Whether to exclude posts with this post type from front end search results.

There isn't such kind of feature to include/exclude in web/google search, you might consider creating your custom robots.txt file:
hidden link

#1153037

My issue is resolved now. Thank you!

I used this code - hidden link