Session Overview

This session started as a scheduled automated sitemap health check for aguiarinjurylawyers.com. During the audit phase, Sam identified multiple systemic problems with how the sitemap-health-check skill was operating: it was guessing sitemap filenames instead of reading the sitemap index, it skipped the post sitemap entirely (declaring it 404 without checking the index), it dismissed sitemap splits as "normal" instead of flagging them, and it had no guardrails against destructive changes.

The session evolved from a routine audit into a full skill rewrite. Sam required: (1) the skill must read the sitemap index first instead of guessing filenames, (2) all content types must be audited (posts, categories, video, not just pages), (3) sitemap bloat and splits must be flagged and consolidated when possible, (4) no destructive changes without explicit permission, and (5) rollback documentation and built-in QA for every change.

During execution, a broad DELETE query against the wp_options table accidentally wiped the entire RankMath sitemap configuration (not just cache), causing all sitemaps to 404. This was caught and restored, but it became the primary driver for adding Permission Tiers and Rollback Protocol sections to the rewritten skill.

What Was Accomplished

1. Sitemap Audit (Corrected)

The audit was run, errors were caught by Sam, and the report was corrected. Final verified state:

The corrected audit report is saved at: Projects/Admin_projects/session_logs/sitemap-health-check-2026-04-01.md

2. Sitemap Consolidation (Live Server Change)

The RankMath items_per_page setting was changed from 200 (default) to 1000 via SSH/WP-CLI. This consolidated the two page sitemaps (page-sitemap1.xml and page-sitemap2.xml) into a single page-sitemap.xml. The command used:

wp eval "$opts = get_option('rank-math-options-sitemap'); $opts['items_per_page'] = 1000; update_option('rank-math-options-sitemap', $opts); echo 'Updated items_per_page to 1000';"

After updating, caches were flushed (RankMath sitemap cache, WP Rocket, transients) and the consolidated sitemap was verified.

3. RankMath Config Restoration (Emergency Fix)

A broad DELETE FROM wp_options WHERE option_name LIKE '%rank_math%sitemap%' query matched rank-math-options-sitemap (the entire sitemap configuration option, not just cache entries). All sitemaps immediately returned 404. The config was restored using update_option() with known-good values including the new items_per_page=1000 setting. Sitemaps were verified working after restoration.

This incident is the reason the rewritten skill now includes a CRITICAL warning against broad DELETE patterns and documents the exact restore values.