Search Exclude

Описание

С помощью этого плагина можно исключить любую запись, страницу, или прочую таксономию из результатов поиска WordPress, установив соответствующий флажок на странице редактирования записи.
Поддерживается быстрое и массовое редактирование.

На странице настроек плагина также можно посмотреть список всех записей, которые скрыты от поиска.

Presentation

QuadLayers | Community

Скриншоты

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

Установка

  1. Загрузите каталог search-exclude в /wp-content/plugins/
  2. Активируйте плагин используя меню ‘Плагины’ в WordPress
  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

Часто задаваемые вопросы

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.

Если вы хотите, чтобы записи/страницы были скрыты от поисковых систем, вы можете добавить следующий сниппет в 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');

Примечание: уже проиндексированные страницы будут оставаться проиндексированными довольно долгое время. Чтобы удалить их из индекса Google, вы можете использовать Google Search Console (или аналогичный инструмент для других поисковых систем).

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.

Допустим, вам нужно отключить фильтрацию поиска при поиске по определенному post_type.
В этом случае вы могли бы добавить в functions.php следующий код:

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

Отзывы

18.06.2023
I use an ad blocker so I haven't been troubled by adware. Your plugin appears to work well and I appreciate the option is located in the Quick Edit. However, the option does not show in Quick Edit when selecting multiple pages.
03.05.2023
We have begun removing this plugin from hundreds of client websites as it adds a great deal of unnecessary bloat and advertisements in the backend. Too bad! However, we found another plugin, Hide from Search, which we heavily tested, is actively updated and has an added feature. Sorry to see good things go so bad... glad to see that there are almost always alternatives in the WordPress way!
17.04.2023 2 ответа
Was a simple good plugin, but now adds commercials for Quadlayers to my dashboard. Unprofessional. Avoid!
17.04.2023 3 ответа
Used to be a great plugin. Not anymore. Acquired by April 2023 by a company called QuadLayers, which bloated the plugin on its first update after changing hands. Why can't we have nice things?
14.04.2023 2 ответа
This used to be a great, lightweight, useful plugin. Then, it was bought out by some software company that started filling it with bloat and adware. You're much better off finding some other solution, or forking the plugin as it was before QuadLayers got involved.
Посмотреть все 75 отзывов

Участники и разработчики

«Search Exclude» — проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

«Search Exclude» переведён на 3 языка. Благодарим переводчиков за их работу.

Перевести «Search Exclude» на ваш язык.

Заинтересованы в разработке?

Посмотрите код, проверьте SVN репозиторий, или подпишитесь на журнал разработки по RSS.

Журнал изменений

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

  • Первый релиз