=== Beplus Search Visibility ===
Contributors: rimbeplus
Tags: search, exclude from search, noindex, sitemap, seo
Requires at least: 6.0
Tested up to: 7.1
Stable tag: 1.2.0
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Hide posts, pages, or entire post types from your site search, and noindex them for search engines — sitemap included.

== Description ==

Beplus Search Visibility lets you keep individual posts, pages, or whole post types out of your site's search results — without unpublishing them or blocking search engines. Excluded content still displays normally everywhere else: the homepage, archives, RSS feeds, and direct links.

= Key Features =

* Per-post exclude — a simple checkbox on the post/page edit screen, in a "Search Visibility" box.
* Quick toggle column — a "Search" column on the post list screen lets you flip a post's visibility with one click, no need to open it.
* Bulk actions — exclude or re-include many posts at once from the list screen.
* Whole post type exclude — remove an entire post type (e.g. a "Testimonials" custom post type) from search results with one setting, no per-post work needed.
* Choose which post types get the feature — enable the per-post checkbox and column only where you need them.
* wp-admin search is never affected — editors can always find excluded content to manage it; only the public front-end search is filtered.
* Per-post SEO noindex — an independent "Exclude from SEO (noindex)" checkbox to keep a post out of search engines entirely, separate from the site-search checkbox above.
* Whole post type noindex — noindex an entire post type with one setting, no per-post work needed.
* SEO column on the post list — a one-click Indexed / Noindex toggle and bulk actions, just like the Search column.
* Noindexed content is removed from the WordPress XML sitemap — individual posts and whole post types — so Google Search Console doesn't flag "Submitted URL marked noindex".
* Noindexing a whole post type also noindexes its archive page.
* Noindex plays well with other SEO plugins — added through WordPress core's own `wp_robots` filter (5.7+), which merges every plugin's robots directives into a single tag, instead of printing a competing `<meta name="robots">` of its own.

= How It Works =

1. Enable the feature for one or more post types in **Settings > Search Visibility**.
2. On any enabled post type, check "Exclude this from search results" and/or "Exclude from SEO (noindex)" in the Search Visibility box — the two are independent — or use the Search column's toggle / the bulk action on the list screen for site-search exclusion.
3. The plugin hooks into `pre_get_posts` to remove excluded posts (and, optionally, entire excluded post types) from the public search query, and into `wp_robots` to add noindex for posts or post types marked for it.

= Known Limitations =

* The REST API search endpoint (`/wp-json/wp/v2/search`) is not filtered in this version — only the front-end `s=` search query is affected.
* wp-admin's own post list search is intentionally left unfiltered, so editors can always find excluded content to manage it.

= About BePlus =

This plugin is developed and maintained by [BePlus](https://beplusthemes.com), a WordPress and Shopify development studio with 10+ years of experience building themes and plugins for nonprofits and eCommerce brands.

Learn more at [beplusthemes.com](https://beplusthemes.com).

== Installation ==

1. Upload the `beplus-search-visibility` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings > Search Visibility** to choose which post types get the feature.

== Frequently Asked Questions ==

= Does excluding a post remove it from my site? =

No. The post stays published and visible everywhere — homepage, archives, RSS, direct link. It's only left out of the results when someone uses your site's search.

= Does this affect the search box inside wp-admin (the post list screen)? =

No. Excluding a post only affects the public front-end search. Editors can still find and manage excluded posts normally from the wp-admin post list.

= Can I exclude a whole custom post type instead of marking each post? =

Yes. Go to **Settings > Search Visibility** and add the post type to the "Exclude entire post type from search" list.

= Does this work with the Block Editor and Classic Editor? =

Yes, the Search Visibility metabox works in both.

= Will the noindex feature conflict with Yoast SEO or Rank Math? =

No. It adds noindex through WordPress core's `wp_robots` filter, which combines every plugin's robots directives into one `<meta name="robots">` tag rather than each plugin printing its own — so it merges cleanly with whatever your SEO plugin outputs.

= Are noindexed posts removed from the sitemap? =

Yes, from WordPress core's built-in sitemap (`/wp-sitemap.xml`). If you use the sitemap from another SEO plugin such as Yoast or Rank Math, exclude the posts there too, since those plugins generate their own sitemap.

= Is "Exclude from search" the same as "Exclude from SEO (noindex)"? =

No, they're independent. Excluding from search only hides a post from your own site's search box; the post can still be indexed by Google. Noindex asks search engines not to index the post at all; it's still included in your site's own search unless you also check the search-exclude box.

== Screenshots ==

1. Search Visibility metabox on the post edit screen.
2. Search and SEO columns with one-click toggles on the post list screen.
3. Settings page for choosing which post types get the feature.

== Changelog ==

= 1.2.0 =
* New: SEO column on the post list with a one-click Indexed / Noindex toggle, plus "Noindex" and "Index" bulk actions.
* New: Noindexed posts and post types are removed from the WordPress core XML sitemap.
* New: Noindexing a whole post type now also noindexes its archive page.
* New: "Settings" link on the Plugins screen.
* Fix: Whole-post-type search exclusion now works with themes that search with `post_type=any`.
* Fix: Search results update immediately when exclusions change outside the plugin's own screens (imports, REST API, WP-CLI).

= 1.1.0 =
* New: "Exclude from SEO (noindex)" — an independent per-post checkbox and a whole-post-type setting, added via WordPress core's `wp_robots` filter so it merges cleanly with other SEO plugins instead of competing with them.

= 1.0.1 =
* Improvement: Confirmed compatibility with WordPress 7.1.

= 1.0.0 =
* Initial release.
* Per-post exclude via a metabox on the post edit screen.
* Quick toggle column and bulk actions on the post list screen.
* Settings page: enable per-post exclude per post type, or exclude an entire post type from search.

== Upgrade Notice ==

= 1.2.0 =
Noindexed content is now removed from the core XML sitemap, and a new SEO column with bulk actions makes noindex easy to manage from the post list.

= 1.1.0 =
Adds an independent "Exclude from SEO (noindex)" option, separate from search-exclude. No action needed — the new option is off until you enable it in Settings > Search Visibility.

= 1.0.0 =
Initial release — no upgrade steps required.
