=== Subset SEO ===
Contributors: functionform
Tags: seo, meta description, schema, xml sitemap, open graph
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.8.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Titles, meta descriptions, canonical and robots tags, Open Graph, Schema.org JSON-LD, XML sitemaps and breadcrumbs. Quiet, fast and portable.

== Description ==

Subset SEO handles a site's technical SEO: the tags search engines and social networks read, the sitemaps they crawl and the structured data they use for rich results. Set sensible defaults once, then override them post by post from the editor.

It adds no dashboard widgets, no admin notices, no score in the admin bar and no tracking. Problems show up in Site Health.

**Titles and descriptions**

* Templates for every post type, taxonomy and archive, with variables such as `%%title%%`, `%%sep%%`, `%%sitename%%`, `%%category%%` and custom fields.
* A per-post title, description and focus keyphrase, with a live snippet preview in the editor.
* Optional suggestions from your own OpenAI, Anthropic or OpenRouter account. Nothing is sent until you click **Suggest**.

**Head tags**

* Canonical URLs, robots directives through WordPress's own `wp_robots`, pagination links, and attachment pages that redirect to their file or parent.
* Open Graph and Twitter cards, with per-post overrides and image fallbacks.
* A Schema.org JSON-LD graph: WebSite, Organization or Person, WebPage, Article, BreadcrumbList and the author, connected by ID so search engines read it as one graph.

**Sitemaps and indexing**

* XML sitemaps for post types, taxonomies and authors, with images, cached and rebuilt when content changes.
* Optional IndexNow pings when you publish, update or trash content.
* Per-type noindex, switches for author and date archives, and a robots.txt editor.

**In the editor**

* A sidebar in the block editor, and a meta box in the classic editor.
* Content checks for the keyphrase, length, links, images and readability, shown as a plain list of what to look at. There's no score to chase.
* A primary category for posts with more than one, used in breadcrumbs and schema.

**Everywhere else**

* Breadcrumbs as a block, a shortcode (`[subset_seo_breadcrumbs]`) or a theme function.
* Title and description columns in the Posts and Pages lists, with quick and bulk edit.
* Import from Yoast SEO, Rank Math, All in One SEO and SEOPress, including titles, descriptions, social fields, robots settings and primary terms.
* Works with WooCommerce, Polylang, WPML and Elementor, and on multisite. Steps aside on the front end while another SEO plugin is active, so a site never prints two sets of tags.

**Fast**

On the front end, Subset SEO reads one cached option and post meta that WordPress has already loaded. The editor sidebar loads only in the editor.

= For developers =

Every tag, template variable, schema piece, sitemap entry and content check has a filter, and the meta keys are documented so other plugins can read them. There's a REST API under `subset-seo/v1` and WP-CLI commands under `wp subset seo`, for meta, sitemaps, settings and imports. See `docs/developer.md` and `docs/rest-cli.md` in the plugin folder.

= Source code =

The editor scripts in `assets/js/build/` are minified. Their readable source ships with the plugin in `assets/js/src/`, and `bin/build-js.mjs` is the esbuild script that bundles them. To rebuild them, install Node.js 22 or later, then run `npm install --no-save esbuild@0.25` and `node bin/build-js.mjs` in the plugin folder. `node bin/build-js.mjs --watch` rebuilds on every change and doesn't minify.

= Privacy =

Subset SEO doesn't track visitors, set cookies or phone home. It contacts an outside service only when you turn on a feature that needs one:

* **AI suggestions** (off by default). When someone clicks **Suggest** in the editor, the post's title, focus keyphrase and first 6,000 characters of text, with the site's name and language, go to the provider chosen under Subset → SEO: [Anthropic](https://www.anthropic.com/legal/privacy), [OpenAI](https://openai.com/policies/privacy-policy/) or [OpenRouter](https://openrouter.ai/privacy). No author, visitor or other post data is sent. `docs/ai.md` lists every field.
* **IndexNow** (off by default). When content is published, updated or trashed, its URL, the site's host name and the site's IndexNow key go to [api.indexnow.org](https://www.indexnow.org/), which shares them with the search engines that take part, such as Bing, Yandex, Naver and Seznam. See the [IndexNow terms](https://www.indexnow.org/terms).

== Installation ==

1. Install and activate Subset SEO from Plugins → Add New.
2. Go to Subset → SEO and fill in the General tab: whether the site represents an organization or a person, and its name and logo.
3. Coming from another SEO plugin? Run the import under Subset → SEO → Tools, then deactivate the old plugin.
4. Open any post and look for the Subset SEO panel in the editor's sidebar.

== Frequently Asked Questions ==

= How is this different from Yoast SEO? =

It does the same technical work, with less in the way. There's no traffic-light score, no dashboard widget, no notices and no upsell screens. The content checks are a list of facts about the text rather than a grade. Its output follows each spec, and every part of it can be filtered. Your Yoast data comes across with the importer.

= Can I switch from Yoast SEO, Rank Math, All in One SEO or SEOPress? =

Yes. Subset → SEO → Tools imports titles, descriptions, focus keyphrases, social fields, robots settings, canonical URLs and primary terms for posts and terms, plus each plugin's title templates where they have an equivalent. The import runs in steps, so it works on large sites, and it doesn't change or delete the old plugin's data. You can also run it with `wp subset seo import`.

= What happens if another SEO plugin is still active? =

Subset SEO keeps its own tags, schema and sitemaps off the front end until you deactivate the other plugin, and says so in Site Health. Its settings and the editor stay available, so you can import and check everything first.

= Does it handle redirects? =

No. Redirects and 404 logging belong in a redirect plugin. If Subset Redirect is active, Subset SEO points to it from its settings, and the two work together: a Subset Redirect rule wins over an attachment-page redirect, and a redirect that lands on an attachment page goes straight to that page's final destination.

= Does it work with WooCommerce? =

Yes. It leaves the shop page's title to WooCommerce and describes products as ordinary pages, so it doesn't clash with WooCommerce's own product schema.

= Does it work with multilingual sites? =

Yes, with Polylang and WPML. Sitemaps list every language, and `og:locale` follows the page's language. Polylang and WPML print their own hreflang tags.

= Is there a score? =

No. The editor lists what it noticed, sorted into problems and notes. The checks for readability are written for English.

= What's left behind when I delete it? =

Deleting the plugin removes its settings and caches. Post and term SEO fields stay, so they're there if you reinstall or import them elsewhere. To remove those too, use **Remove all Subset SEO data** under Subset → SEO → Tools first.

== Screenshots ==

1. The editor sidebar: a search result preview, with the post's own SEO title and meta description.
2. Content checks for the focus keyphrase, links and images, as a plain list of problems, notes and what's good.
3. Subset → SEO: title and description templates for the home page and every content type.
4. SEO title and meta description columns in the Posts list, editable with quick edit.
5. Subset → SEO → Tools: preview an import from Yoast SEO before running it.

== Changelog ==

= 0.8.1 =
* Security: The Subset menu and its Overview page now need the same capability as a Subset page you can open, so a subscriber no longer reaches the Overview.
* Changed: Built on subset-core 1.13.3.

= 0.8.0 =
* Security: on a site with open registration, a subscriber can no longer make their author archive indexable or give it their own title, description or canonical. Changing a user's SEO fields now needs the edit_posts capability or the plugin's own, and an author archive ignores fields saved by users without them. An author's own "index" choice only counts once they have a published post.
* Security: authors and editors can no longer set a canonical URL on another site, for a post, term or author. That needs the plugin's capability. Same-site canonicals work as before, and saving a form that holds an admin's off-site canonical keeps it.
* Security: files attached to a draft, private or password-protected post stay out of the sitemap, and their attachment pages are no longer indexable.
* Security: the editor's link check no longer reveals drafts or private posts the user can't read.
* Changed: each user can ask for AI suggestions 60 times an hour, then is asked to wait.
* New for developers: `subset_seo_ai_suggest_limit` changes how many AI suggestion requests a user may make an hour.
* Security: on some servers, WP-CLI commands that asked an AI provider for suggestions printed the provider's API key. They no longer do.
* Changed: Built on subset-core 1.13.2.

= 0.7.0 =
* Fixed: `wp help` for the `meta` command shows a whole sentence as its summary, not a cut-off one.
* Changed: Imports from other SEO plugins run on the admin code the Subset plugins share, and import and suggestion errors are worded as in the other Subset plugins. Imports work as before.
* Under the hood: the importers share more code with the other Subset plugins.
* Changed: Built on subset-core 1.13.0.

= 0.6.1 =
* Fixed: The Quick Edit and Bulk Edit boxes on the posts list no longer print two hidden fields with the same id, `subset_seo_inline_nonce`. Duplicate ids are invalid HTML.

= 0.6.0 =
* New for developers: `subset_seo_admin_enqueue` runs when the settings screen loads its scripts, with the current tab. Add-on tab slugs now go through `sanitize_key()`, so a slug like `Bad Tab` becomes `badtab` instead of being dropped.
* Under the hood: shares more code with the other Subset plugins.

= 0.5.1 =
* Fixed: `wp help` for the `settings` command is written for users, and its examples use this plugin's own command.
* Changed: Built on subset-core 1.9.1.

= 0.5.0 =
* AI suggestions run on the shared Subset AI code. Saved API keys, models and error messages are unchanged.
* Site Health's plugin-conflict check is built on the shared Subset health checks. Its result is unchanged.
* Built on subset-core 1.9.0.

= 0.4.1 =
* Subset SEO Pro can load the image picker (the classic script, the media library and the form styles) on its own screens with `Editor\Assets::enqueue_classic()`, instead of reaching into this plugin's files.

= 0.4.0 =
* AI suggestion requests send a `Subset/<version>` user agent instead of WordPress's default, which included the site's address.
* An import found running on the Tools tab is followed in place and announced to screen readers, instead of the page reloading itself every second. In the classic meta box, term and user forms, the Search engines controls are a named group and the follow select has its own name.
* Two requests can no longer both take over a lapsed import lock and work on the same import at once.
* New WP-CLI commands: `wp subset seo settings list|get|set|reset` to manage settings, and `wp subset seo meta wipe` to remove SEO data like the Tools tab does. `reset` keeps settings that add-ons store.
* Pages build their SEO tags with fewer database queries: author archives no longer count every post, and each page's details are worked out once per request.
* The Advanced tab's pointer to redirects names Subset › Redirects instead of Tools › Redirects.
* The Plugins screen lists the author as Function Form.
* Subset SEO Pro can reuse the sitemap XML helpers instead of keeping its own copies.
* Built on subset-core 1.8.1.

= 0.3.1 =
* The About tab uses plain WordPress admin styling.

= 0.3.0 =
* The SEO screen now lives under the shared Subset menu (Subset > SEO). Old Settings > Subset SEO links redirect to the new screen.
* Accessibility and editor fixes: the editor no longer re-reads the whole post on every change; image Choose, Replace and Remove buttons say which field they belong to; help text and character counts are announced with their fields; the snippet preview stops repeating itself to screen readers; and the preview and admin colours now work in high-contrast mode and right-to-left languages.

= 0.2.0 =
* Extension points for add-ons: a slot for panels at the end of the editor sidebar, the `subset_seo_indexable`, `subset_seo_sitemap_images` and `subset_seo_schema_article_type` filters, sitemap types that write their own XML (`XmlProvider`), keyphrase synonyms and word forms in the analysis (`subset_seo.analysis.paper` and `subset_seo.analysis.ran`), and AI provider rows on the settings screen.

= 0.1.0 =
* First release.
