=== Search Snippet Control for Blocks ===
Contributors: weareallconnected
Tags: seo, search, block editor, content control, ai
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Control whether supported WordPress blocks can be used in search snippets and AI-generated answers.

== Description ==

Search Snippet Control for Blocks adds a toggle within Advanced settings of supported blocks to add a `data-nosnippet` tag, which excludes that content from search snippets and AI answers. The plugin adds the toggle to these blocks:

- Group
- Columns
- Column
- Cover
- Media & Text
- Buttons
- Button

The switch is on by default, which leaves the block’s normal HTML unchanged. Turning it off adds `data-nosnippet` directly to the block’s existing `div`, `section`, or `span` root during server rendering.

The plugin is designed to be as lightweight as possible and never adds a wrapper. Paragraphs, Headings, Images, Lists, and other content blocks can be placed inside a Group or other supported block when an editor wants to exclude that section from search snippets and AI-generated answers.

Note that adding `data-nosnippet` does not change indexing or organic search visibility - only the wrapped contents' eligibility for inclusion in snippets and AI answers.

== Installation ==

1. Upload the `search-snippet-control-for-blocks` directory to `/wp-content/plugins/`.
2. Activate Search Snippet Control for Blocks in WordPress.
3. Select a supported block and open its Advanced settings.
4. Turn off "Allow search engines to use this content in search snippets and AI-generated answers? Does not affect normal indexing." and save the post.

== Frequently Asked Questions ==

= I can't see the control for some blocks (Paragraph, Image etc.) =

To avoid compatibility and/or layout issues, the toggle is only available on blocks that already use compatible `div`, `section` or `span` elements, where the `data-nosnippet` tag can be added. You can simply put the content you wish to exclude within a supported layout block such as a Group.

= Does this have an impact on SEO? =

No, applying `data-nosnippet` to page elements expressly only removes their eligibility for inclusion in search snippets and AI answers. All page content is still crawled and indexed as normal.

= My content is still being included in AI answers! Why? =

Sometimes other plugins may output the entire page contents in the articleBody schema field without taking into account visibility controls, which renders on-page `data-nosnippet` tags useless. Unfortunately there's nothing we can do about this - we would recommend contacting the plugin author and asking them to add support for `data-nosnippet` exclusions.

== Screenshots ==

1. Toggle enabled by default, enabling content within this block to be used in snippets.
2. Disabling the toggle adds the data-nosnippet tag to the block, preventing content within that block being used in search snippets and AI answers.
3. The data-nosnippet tag is added to existing divs, with minimal impact on speed and no extra elements added to the page.

== Changelog ==

= 0.2.0 =

* Make the search-engine usage control on by default and add data-nosnippet only when it is turned off.
* Use one stable toggle label and help message in both states.
* Identify We Are All Connected as the plugin author and add initial WordPress.org directory metadata.
* Rename the plugin to Search Snippet Control for Blocks and use search-engine-neutral interface copy.
* Confirm compatibility with WordPress 7.1.

= 0.1.1 =

* Verify the expected wp-block-* root class before applying data-nosnippet, preventing accidental targeting of markup prepended by another renderer.
* Reject non-string block content defensively before HTML processing.
* Guard against double loading with class and constant checks.
* Adopt the current ToggleControl margin convention in the editor control.

= 0.1.0 =

* Initial development release.
* Support seven core container blocks with direct-root rendering.
* Do not add wrappers or apply ancestor-based exclusions.
