';
+ esc_html_e( 'No plugins were selected to import from.', 'noindex-seo' );
+ echo '
';
+ }
+ if ( isset( $_GET['plugin_import_done'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only result flag set by our own handler after a nonce check.
+ echo '
';
+ esc_html_e( 'The selected plugins had no importable robots data left.', 'noindex-seo' );
+ echo '
+
+
] [--format=]` — lists every context × directive pair and its on/off status (table, csv, json or yaml).
-* `wp noindex-seo set [...]` — enables directives on a context (default: all five). Example: `wp noindex-seo set search noindex noarchive`.
+* `wp noindex-seo set [...]` — enables directives on a context (default: all six boolean directives). Boolean directives go by name; value directives as `name=value`: `wp noindex-seo set search noindex noarchive`, `wp noindex-seo set archive max-snippet=-1 max-image-preview=large`.
* `wp noindex-seo unset [...]` — disables directives on a context.
* `wp noindex-seo export []` — prints the settings payload as JSON to STDOUT, or writes it to a file.
* `wp noindex-seo import [--dry-run]` — restores settings from an export; `--dry-run` reports how many values would change without saving.
@@ -122,15 +132,35 @@ The commands enforce the same rules as the settings page (unknown contexts and d
The settings page includes an "Export settings" button that downloads the current global settings as a JSON file, and an "Import settings" form that restores them on the same or another site (useful for migrations and staging-to-production copies). Imports are strictly validated, and per-post / per-term overrides are never touched.
+= Robots.txt =
+
+A dedicated "Robots.txt" tab extends the robots.txt that WordPress generates virtually with bot rules — it never replaces the core output and is inactive until you enable it:
+
+* Block (`Disallow: /`) or allow (`Allow: /`) individual crawlers, with `*` wildcard rules supported.
+* One-click presets add the well-known AI crawlers (GPTBot, ClaudeBot, Google-Extended, CCBot, Bytespider…) or the main search engine crawlers (Googlebot, Bingbot, DuckDuckBot…) as blocked rules — edit them freely afterwards. Both lists are filterable.
+* Rules only apply when WordPress serves robots.txt itself: a physical robots.txt file in the site root, or "Discourage search engines" in Reading settings, takes precedence.
+
+= Import from other plugins =
+
+The "Import / Export" tab detects robots data left by other SEO plugins — Yoast SEO, Rank Math, SEOPress and All in One SEO (installed or not) — and imports their noindex / nofollow flags as per-post and per-term overrides. Nothing imports automatically: you pick the detected plugins and confirm. Content that already has its own override — even a disabled one — is never touched and is reported as skipped.
+
= REST API =
The plugin exposes two read-only endpoints under `/wp-json/noindex-seo/v1/` so headless consumers can read the configuration:
* `GET /settings`: returns the consolidated settings array (contexts and directives plus config). Requires an authenticated user with the `manage_options` capability.
-* `GET /effective?post_id=123`: returns the list of active directives for a specific post, computed with the same precedence used on the front-end (per-post override, then per-post-type default, then the built-in context). Public only for published, non-password-protected posts; everything else requires `edit_post` capabilities.
+* `GET /effective?post_id=123`: returns the list of active directives for a specific post, computed with the same precedence used on the front-end (per-post override, then conditional rules, then per-post-type default, then the built-in context). Value directives return as `name:value` tokens (e.g. `max-snippet:-1`); `source` is `post_meta`, `auto_rule` (a conditional rule matched) or `global_setting`. Public only for published, non-password-protected posts; everything else requires `edit_post` capabilities.
On WordPress versions with XML sitemaps (5.5+), URLs that are noindexed are automatically excluded from the core sitemaps.
+== Multisite ==
+
+The plugin is designed **per site** and works on WordPress Multisite when activated on each site individually (or via the Network Admin's "Add Plugin" per-site flow):
+
+* Directives are site-content concerns, so every site keeps its own independent settings, per-post overrides, per-term overrides and conditional rules (stored per site, no network-wide storage).
+* There is no network-admin settings page and no `Network: true` header by design: activating the plugin network-wide would apply each site's own settings anyway (each site reads its own options), so per-site activation is the intended and documented mode.
+* To roll out the same configuration across sites, use the built-in export/import (Tools tab, JSON) or `wp noindex-seo export` / `wp noindex-seo import` per site — for example with WP-CLI's `--url` switch.
+
== Installation ==
= Automatic download =
@@ -162,18 +192,18 @@ No. By default all plugin data is preserved on uninstall. If you want a complete
== Changelog ==
+= 3.7.0 =
+
+Feature release: on-demand import of robots overrides from other SEO plugins (Yoast SEO, Rank Math, SEOPress, All in One SEO — detected with or without them installed, never overwriting existing data) and virtual robots.txt management: block or allow individual crawlers (AI and search-engine presets included) appended to the robots.txt WordPress generates, inactive by default.
+
+= 3.6.0 =
+
+Feature release: 5 modern robots directives (notranslate, max-snippet, max-image-preview, max-video-preview, unavailable_after) available on every surface — global contexts, per-post and per-term overrides, Quick Edit, the block editor sidebar, REST and WP-CLI (name=value tokens); conditional auto-noindex rules that apply noindex when a custom field (e.g. an ACF field) exactly matches a value (matched posts also drop out of the XML sitemap); Multisite behavior documented (per-site by design, with export/import-based rollout).
+
= 3.5.0 =
WooCommerce special-page contexts: dedicated robots directives for the Cart, Checkout and My Account pages (detected through the page-ID options, no WooCommerce code needed), recommended by default and mirrored across the front-end, the REST /effective endpoint and the core XML sitemaps. Compatibility window updated to WordPress 7.0 - 7.2 and PHP 8.3 - 8.6 (tested on WordPress 7.2-beta3 and PHP 8.6.0RC3). The five directive icons now render as SVG through the WordPress Icons API on WP 7.2+ (legacy emoji fallback on WP 7.0 - 7.1), matching the SVG direction of the WordPress 7.2 admin. Fixed the `wp noindex-seo list` command, which fatalled on real WP-CLI installs (its `--context` filter collided with WP-CLI 2.11+'s reserved global flag, now `--only`, and the output call used a nonexistent API).
-= 3.4.0 =
-
-WP-CLI support: a `wp noindex-seo` command namespace with `list`, `set`, `unset`, `export`, `import` and bulk per-post `override` — automation-friendly and scaling past the ~200-post ceiling of the bulk UI.
-
-= 3.3.0 =
-
-Settings page reorganized with the native WordPress tab navigation (General / SEO Settings / Import-Export, no custom tab code) and titled sections; saving is tab-scoped so hidden tabs never reset each other's values.
-
= Previous versions =
If you want to see the full changelog, visit the [noindex SEO plugin page](https://www.robotstxt.software/plugins/noindex-seo/).
@@ -194,6 +224,6 @@ This plugin adheres to the following security measures and review protocols for
== Vulnerabilities ==
-* No vulnerabilities have been published up to version 3.5.0.
+* No vulnerabilities have been published up to version 3.7.0.
Found a security vulnerability? Please report it to us privately at the [noindex SEO GitHub repository](https://github.com/javiercasares/noindex-seo/security/advisories/new).
diff --git a/uninstall.php b/uninstall.php
index a73ff35..44abb99 100644
--- a/uninstall.php
+++ b/uninstall.php
@@ -137,7 +137,8 @@ $wpdb->query(
)
);
-// Clean up post meta (granular control).
+// Clean up post meta (granular control). The 3.6.0 value directives store
+// their per-post values under the same prefix.
$noindex_seo_meta_keys = array(
'_noindex_seo_override',
'_noindex_seo_noindex',
@@ -145,6 +146,11 @@ $noindex_seo_meta_keys = array(
'_noindex_seo_noarchive',
'_noindex_seo_nosnippet',
'_noindex_seo_noimageindex',
+ '_noindex_seo_notranslate',
+ '_noindex_seo_max-snippet',
+ '_noindex_seo_max-image-preview',
+ '_noindex_seo_max-video-preview',
+ '_noindex_seo_unavailable_after',
);
foreach ( $noindex_seo_meta_keys as $noindex_seo_meta_key ) {