Archive SEO
Technical documentation for managing Archive SEO settings in Site Essentials via WordPress options keys. Covers fixed and dynamic option storage patterns, template tokens for titles and descriptions, payload schemas for post types and taxonomies, and CLI commands for reading and writing archive metadata without using the admin interface.
Table Of Contents
Who is this for
Archive SEO wp_options keys
(get_option / update_option / delete_option)
options are created on first update_option, No add_option( 'scos_seo_*' )
Fixed option keys
| Key | Purpose | Read | Write |
|---|---|---|---|
scos_seo_freeze_modified_date | Global “freeze modified date” ('1' or empty) | Meta_Box.php, views/archive-meta.php | Archive_Settings.php (update_option on Meta Tags save) |
scos_seo_author_rewrite_ver | MD5 of custom author base; triggers one flush_rewrite_rules | Archive_Settings.php | update_option / delete_option in Archive_Settings.php |
Dynamic option keys (pattern)
| Pattern | Purpose | Read | Write |
|---|---|---|---|
scos_seo_archive_{slug} | Serialized array of archive SEO settings | Archive_Settings::get() → get_option( OPTION_PREFIX . sanitize_key( $slug ) ) | Archive_Settings::save() → update_option(...) |
Notes on Usage
{slug} values come from Archive_Settings::get_archives()
Each option stores a merged array (fields vary by slug).
- Admin query param
?scos_seo=disabledinAdmin_UI.php
post— blog archive- Every public, non–built-in CPT (e.g.
project,service,faq, … — site-specific) author,date,search,404— special archives
Each option stores a merged array (fields vary by slug).
Common keys inside the array: title, description, breadcrumb_title, robots, tldr, sitemap_exclude, og_image_id, pagination_noindex, canonical_paged, rel_prevnext; author/date/search also disabled, redirect_url; author also author_slug.
Not an option:
scos_seo_title_sep is a apply_filters() hook name in Archive_Settings.php, not get_option.
Archive SEO Template Tokens & Use
| Token | Use |
|---|---|
%title% | Archive / term / author / blog title |
%sitename% | Site name |
%sep% | Separator (default –; filter scos_seo_title_sep) |
%page% | Page N on paginated archives |
%term% | Term name (taxonomy) |
%taxonomy% | Taxonomy plural label |
%description% | Term description (taxonomy) |
%author% | Author display name |
%search% | Search query |
Example title: %title% %sep% %sitename%
Important: Do not run values through sanitize_text_field() in a way that breaks % tokens (e.g. %description% is valid). Plain strings are fine for MCP; PHP admin uses sanitize_template_field() which preserves tokens.
Filling SEO Archive Options (Meta Tags tab)
Admin UI: wp-admin/admin.php?page=site-essentials-seo&tab=meta
Storage: one option per archive slug: scos_seo_archive_{slug}
Same tab also sets: scos_seo_freeze_modified_date (global, not per archive)
AI/MCP task: fill SEO Archive Options (Meta Tags tab)
Storage: one option key per archive slug: scos_seo_archive_{slug},
Each option stores a merged array (fields vary by slug).
1. Discover slugs on this site (run first)
Do not guess CPT/taxonomy names. Build the slug list the same way Archive_Settings::handle_save() does:
# Post type archives: always includes “post” + public non-builtin CPTs
wp post-type list –_builtin=0 –public=1 –field=name
# Special archives (fixed)
# author | date | search | 404
# Taxonomy archives: category, post_tag, then other public taxonomies
wp taxonomy list –public=1 –field=name
Option key rule: scos_seo_archive_ + sanitize_key( $slug )
Examples: scos_seo_archive_post, scos_seo_archive_project, scos_seo_archive_category, scos_seo_archive_scos_content_cluster (if that taxonomy exists).2. Read before write (merge, do not blind overwrite)
wp option get scos_seo_archive_post --format=json
If missing, treat as {}. When updating one slug, only change that option key; other scos_seo_archive_* keys are independent (unlike the admin form, which re-saves every slug on one submit).3. Write with wp option update (preferred)
Use JSON and WordPress will store the PHP array correctly:
wp option update scos_seo_archive_post '{
"title": "%title% %sep% %sitename%",
"description": "%description%",
"breadcrumb_title": "Blog",
"tldr": "",
"robots": [],
"sitemap_exclude": [],
"og_image_id": 0,
"pagination_noindex": false,
"canonical_paged": false,
"rel_prevnext": false
}' --format=json
Global on same tab (optional):
wp option update scos_seo_freeze_modified_date '1' # enable
# or
wp option update scos_seo_freeze_modified_date '' # disable4. Payload schema by slug type
A. Post type archives — slug post or any public CPT name
| Field | Type | Notes |
|---|---|---|
title | string | Template; tokens below |
description | string | Template; multiline OK |
breadcrumb_title | string | Plain text |
tldr | string | Plain text |
robots | string[] | Subset: noindex, nofollow, noimageindex, nosnippet |
sitemap_exclude | string[] | Subset: xml, html, news |
og_image_id | int | Attachment ID |
pagination_noindex | bool | |
canonical_paged | bool | |
rel_prevnext | bool |
B. Taxonomy archives — slug = taxonomy name (category, post_tag, custom)
Same fields as A (taxonomies are not “special” slugs).
Extra tokens useful here: %term%, %taxonomy%, %description%.C. Special archives — author, date, search, 404
Base fields only: title, description, breadcrumb_title, robots
(No tldr, sitemap_exclude, og_image_id, pagination flags — admin save strips them for special slugs except author partial extras.)
author, date, search also:| Field | Type |
|---|---|
disabled | bool |
redirect_url | string (URL) |
author also:| Field | Type |
|---|---|
author_slug | string |
tldr | string |
og_image_id | int |
404: base fields only (no disable/redirect).6. Verify after write
wp option get scos_seo_archive_post --format=json
wp eval 'var_export( \SiteEssentials\Modules\SeoMeta\Archive_Settings::get("post") );'
Second line confirms merged defaults + saved values (only works if Site Essentials is loaded in CLI — otherwise option get is enough).
Frontend output is consumed by Head_Output.php via Archive_Settings::get( $slug ) — no separate meta keys.7. What NOT to do
| Avoid | Why |
|---|---|
wp post meta update for archive SEO | Wrong storage layer |
| Guessing slugs from another site | CPT/tax list is per site |
POSTing to admin-post.php?action=site_essentials_save_archive_meta without full scos_archive[all-slugs] | Omitted slugs save as empty arrays for every slug in the loop |
Setting scos_seo_author_rewrite_ver manually | Internal; admin deletes it on save to flush rewrites |
Legacy export keys scos_seo_breadcrumb, scos_seo_isnoindex | Not used by this module |
8. Optional: mimic admin save (usually worse for MCP)
Only if you must use the UI pipeline:
URL: admin-post.php
action: site_essentials_save_archive_meta
nonce: scos_archive_meta_nonce / action scos_save_archive_meta
Capability: manage_options
Body: scos_archive[{slug}][title], etc., plus scos_global[freeze_modified_date] if needed
Requires a logged-in admin session or nonce generation. wp option update per slug is simpler and safer.Copy-paste (Short) MCP system prompt
Task: Fill SCOS SEO archive settings for {site}.
1. List slugs: wp post-type list –_builtin=0 –public=1 –field=name;
add “post”; add special author,date,search,404;
wp taxonomy list –public=1 –field=name.
2. For each slug in scope, read wp option get scos_seo_archive_{slug} –format=json.
3. Write with wp option update scos_seo_archive_{slug} ‘<json>’ –format=json
using the correct schema (CPT/tax vs special vs author).
4. Use template tokens in title/description where appropriate.
5. Optionally set scos_seo_freeze_modified_date to “1” or “”.
6. Verify with wp option get. Do not use post meta. Do not POST admin form unless updating all slugs at once.
Reference: site-essentials/Modules/SeoMeta/Archive_Settings.php
10. Author slug side effect
If you set author_slug onscos_seo_archive_author, the next normal admin save (or code path that calls Archive_Settings::set_author_slug()) may flush rewrite rules. After CLI-only author slug changes, tell the operator to visit Settings → Permalinks → Save once if author URLs look wrong.