# SEO Migration and Outbound Link Health

Help4 Builder Suite 1.3.277 adds two administrator-controlled tools to **Help4 > SEO Control**. Both are bounded, multisite-aware, and idle until an administrator starts them.

## SEO migration

The migration panel reads metadata from these source families:

- Yoast SEO
- All in One SEO, including legacy post metadata and the modern post table when present
- Rank Math
- SEOPress
- The SEO Framework

The importer maps titles, descriptions, canonical URLs, focus phrases, robots choices, social titles, social descriptions, social images, attachment IDs, and supported schema types into native Help4 fields. Common source template variables are resolved against the current post and site during import.

### Safe workflow

1. Open **Help4 > SEO Control**.
2. Select a source or use auto-detection.
3. Choose **Preview Migration**. Preview scans at most 500 public content items and writes nothing.
4. Review detected fields and existing-value conflicts.
5. Run **Run Import** with overwrite disabled. This fills missing or empty Help4 values and preserves explicit Help4 robots settings.
6. Review representative public pages, social previews, schema, and the sitemap before retiring the previous SEO plugin.

Source metadata is not deleted. The optional overwrite checkbox is the only mode that replaces nonempty Help4 values. A rerun without overwrite is safe and idempotent for already imported Help4 locations.

Supported Yoast and AIOSEO location post types can be converted to `h4_location` content. The importer normalizes address, contact, coordinates, Place ID, map, and basic business fields. Each location receives source-provider and source-ID metadata so a fill-only rerun cannot create a duplicate. Opening-hours formats vary significantly between source versions and should be reviewed in **Help4 > Locations** after migration.

On multisite, migration runs only for the current site's posts, metadata, options, and table prefix. Run the preview separately on each site that used another SEO plugin.

## Outbound link health

The link-health panel discovers external links from:

- Published public post content and excerpts
- Anchor elements saved inside Builder HTML/content fields
- Builder settings whose keys represent URLs, links, href values, or actions

The scan excludes same-site URLs, fragments, unsupported schemes, noindex content, and duplicate external URLs. One result retains up to eight source-content references so editors can find and repair the link.

### Limits and response classes

- Up to 500 published content items per scan
- Up to 2,000 unique external URLs
- 12 requests per batch
- Six-second request timeout
- Initial HEAD request with a bounded GET fallback for servers that reject HEAD
- At most two attempts for request errors, HTTP 429, and HTTP 5xx responses

Results are classified as healthy, redirect, restricted, broken, throttled, server error, request error, or unexpected. HTTP 401/403 is shown as restricted rather than automatically broken because many services block automated requests while remaining available to visitors. Redirects remain visible for editorial review instead of being silently reported as the final destination.

WordPress safe HTTP functions validate every destination to reduce server-side request-forgery risk. The crawler never sends WordPress cookies, visitor data, credentials, page content, form submissions, or customer records. The remote site sees the scanning server IP and a Help4 link-health user agent containing the public site URL. Do not run the scanner against links that should never receive an automated request.

The first batch is scheduled with WP-Cron. **Check Next Batch Now** is available when a site has low traffic or WP-Cron is delayed. Starting a new scan replaces the previous queue and results for the current site.

## Extension points

- `h4bs_seo_migration_providers`
- `h4bs_seo_migration_source_data`
- `h4bs_seo_migration_location_posts`
- `h4bs_seo_migration_result`
- `h4bs_seo_migration_complete`
- `h4bs_seo_link_health_post_ids`
- `h4bs_seo_link_health_urls`
- `h4bs_seo_link_health_result`

Extension code should return normalized, sanitized values and should preserve the same preview-first, fill-only, bounded, and current-site constraints.
