Search Exclude

설명

With this plugin you can exclude any page, post or whatever from the WordPress search results by checking off the corresponding checkbox on post/page edit page.
Supports quick and bulk edit.

On the plugin settings page you can also see the list of all the items that are hidden from search.

Presentation

QuadLayers | Community

스크린샷

  • screenshot-1.png
  • screenshot-2.png

설치

  1. Upload search-exclude directory to the /wp-content/plugins/ directory
  2. 워드프레스의 ‘플러그인’ 메뉴에서 플러그인을 활성화하세요.
  3. Go to any post/page edit page and check off the checkbox Exclude from Search Results if you don’t want the post/page to be shown in the search results

FAQ

Does this plugin affect SEO?

No, it does not affect crawling and indexing by search engines.
The ONLY thing it does is hiding selected post/pages from your site search page. Not altering SEO indexing.

If you want posts/pages to be hidden from search engines you may add the following snippet to your functions.php:

function add_meta_for_search_excluded()
{
    global $post;
    if (false !== array_search($post->ID, get_option('sep_exclude', array()))) {
        echo '<meta name="robots" content="noindex,nofollow" />', "\n";
    }
}
add_action('wp_head', 'add_meta_for_search_excluded');

Note: already indexed pages will remain indexed for quite a while. In order to remove them from Google index, you may use Google Search Console (or similar tool for other engines).

Are there any hooks or actions available to customize plugin behaviour?

Yes.
There is an action searchexclude_hide_from_search.
You can pass any post/page/custom_post ids as an array in the first parameter.
The second parameter specifies state of visibility in search. Pass true if you want to hide posts/pages,
or false – if you want show them in the search results.

Example:
Let’s say you want “Exclude from Search Results” checkbox to be checked off by default
for newly created posts, but not pages. In this case you can add following code
to your theme’s function.php:

add_filter('default_content', 'exclude_new_post_by_default', 10, 2);
function exclude_new_post_by_default($content, $post)
{
    if ('post' === $post->post_type) {
        do_action('searchexclude_hide_from_search', array($post->ID), true);
    }
}

Also there is a filter searchexclude_filter_search.
With this filter you can turn on/off search filtering dynamically.
Parameters:
$exclude – current search filtering state (specifies whether to filter search or not)
$query – current WP_Query object

By returning true or false you can turn search filtering respectively.

Example:
Let’s say you need to disable search filtering if searching by specific post_type.
In this case you could add following code to you functions.php:

add_filter('searchexclude_filter_search', 'filterForProducts', 10, 2);
function filterForProducts($exclude, $query)
{
    return $exclude && 'product' !== $query->get('post_type');
}

후기

2024년 12월 12일 답글 6개
Was working fine for years, but currently doesn’t work for me. Waiting patiently for a response from the support team.
2024년 12월 10일
Works as expected. Only gripe is that the setting is in a separate meta box instead of under the publish or page attributes.https://i.imgur.com/ouOs5PT.png (gutenberg)https://i.imgur.com/XFO5QPO.png (classic) Also the quick edit setting is so far away from the other settings.https://i.imgur.com/cyuVgdm.png
2024년 12월 5일 답글 2개
I recently encountered an issue with the Search Exclude plugin after updating to version 2.1.8. I contacted the support team, and they quickly responded with a resolution. After updating to version 2.2.0, the problem was completely resolved. I truly appreciate the team’s dedication to improving the plugin and providing excellent support. Highly recommend both the product and the support service! Thank you for your efforts!
2024년 11월 28일 답글 2개
A plugin issue was resolved quickly and most respectfully by the Search Exclude team. Brilliant.
모든 154 평가 읽기

기여자 & 개발자

“Search Exclude”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

“Search Exclude”(이)가 3 개 언어로 번역되었습니다. 기여해 주셔서 번역자님께 감사드립니다.

자국어로 “Search Exclude”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

2.2.0

  • Fix php errors

2.1.9

  • Fix php errors
  • Fix compatibility with classic editor

2.1.8

  • WordPress 6.7 compatibility

2.1.7

  • Fix WordPress 6.1.3 compatibility
  • Fix big queries
  • Remove notification

2.1.6

  • Refactor update

2.1.5

  • Refactor

2.1.4

  • WordPress compatibility

2.1.3

  • WordPress compatibility

2.1.2

  • WordPress compatibility

2.1.1

  • Packages update

2.1.0

  • WordPress compatibility

2.0.9

  • Fix PHP errors

2.0.8

  • Translation strings

2.0.7

  • WordPress compatibility

2.0.6

  • WordPress compatibility

2.0.5

  • Update portfolio link

2.0.4

  • WordPress compatibility

2.0.3

  • Fix strings translations

2.0.2

  • Fix strings translations

2.0.1

  • Fix strings translations

2.0.0

  • i18n implemented
  • Composer implemented
  • Autoload implemented
  • Rename files to fit WordPress Development rules
  • Rename classes to fit WordPress Development rules
  • Rename variables to fit WordPress Development rules

1.3.1

  • Author update.

1.3.0

  • Fix and rework bulk edit: The Bulk actions dropdown now offers hide/show actions.

1.2.7

  • This is a security release. All users are encouraged to upgrade.
  • Fix possible XSS vulnerability.

1.2.6

  • Fix compatibility with WordPress 5.5

1.2.5

  • Security release. More protection added.

1.2.4

  • Security release. All users are encouraged to update.
  • Added filter searchexclude_filter_permissions.

1.2.2

  • Added action searchexclude_hide_from_search
  • Added filter searchexclude_filter_search
  • Fixed Bulk actions for Firefox

1.2.1

  • Fixed bug when unable to save post on PHP <5.5 because of boolval() usage

1.2.0

  • Added quick and bulk edit support
  • Tested up to WP 4.1

1.1.0

  • Tested up to WP 4.0
  • Do not show Plugin on some service pages in Admin
  • Fixed conflict with bbPress
  • Fixed deprecation warning when DEBUG is on

1.0.6

  • Fixed search filtering for AJAX requests

1.0.5

  • Not excluding items from search results on admin interface

1.0.4

  • Fixed links on settings page with list of excluded items
  • Tested up to WP 3.9

1.0.3

  • Added support for excluding attachments from search results
  • Tested up to WP 3.8

1.0.2

  • Fixed: Conflict with Yoast WordPress SEO plugin

1.0.1

  • Fixed: PHP 5.2 compatibility

1.0

  • 초기 릴리즈