The CantoThemes journal

How to Use AI Agents to Find Broken Links on WordPress

Use a crawler and AI-assisted review to find broken WordPress links, classify errors, choose useful replacements, and verify the saved fixes.

A small crawler-like inspection device finding broken chain links among webpage paths, with a repair tool selecting a relevant replacement link.

Use an AI agent to organize and review broken-link findings, while a crawler or HTTP-checking tool establishes what each URL actually returns. A model reading an article cannot reliably tell whether a destination is available without checking it.

Keep link discovery, diagnosis, and replacement as separate steps. This avoids replacing a useful link merely because one automated request failed.

Define what to inspect

Start with a known set of posts or a limited crawl of the public website. Include the link’s source page, anchor text, destination URL, and whether it is internal or external.

Decide whether to inspect images, downloads, menu links, and buttons as well as ordinary text links. A missing PDF needs a different replacement from an outdated documentation page.

Exclude private account areas and logout links from an unauthenticated crawl. Do not let a checker submit forms or trigger action URLs.

For a large site, respect reasonable request rates. Link auditing should not create unnecessary load on your own site or external destinations.

Collect real response evidence

Record the response code, final destination after redirects, time checked, and any network error. A successful response does not prove the page contains the expected information.

Google’s HTTP status documentation distinguishes server responses such as success, redirection, and errors. Use those signals as evidence, not as a complete judgment of the link’s usefulness.

Some sites block automated requests or require cookies. A checker receiving a forbidden response does not always mean a normal visitor sees a broken page. Verify uncertain cases in a browser.

Check the final content too. A URL can return a successful response while displaying a generic “not found” message or an unrelated homepage.

Ask the agent to classify the findings

Group failures into categories: missing internal page, outdated external documentation, blocked automated request, redirect chain, missing asset, or temporary network failure.

Require the agent to preserve the evidence and state uncertainty. Do not let it label every non-success response as a permanent broken link.

Prioritize links that block a task: downloads, contact actions, product information, and main navigation. A stale reference deep in an old article matters, but it may be less urgent than a missing quote form.

Keep a short issue record for every proposed fix. Include why the destination is no longer appropriate and what the replacement should accomplish.

Choose replacements that preserve the meaning

For an internal page that moved, link directly to the current relevant destination and maintain an appropriate redirect for old incoming links. Avoid sending every missing URL to the homepage.

For external documentation, locate the current official page that answers the same question. Read it before replacing the link; a similar title does not prove equivalence.

If no suitable replacement exists, rewrite the surrounding sentence or remove the reference. Do not invent a URL based on a plausible slug.

For images and files, verify the actual media item and download. A broken screenshot may also require updating the adjacent instructions.

Review the WordPress edit before saving

Identify the exact post and link occurrence. The same URL may appear several times with different meanings, and a broad find-and-replace can change more than intended.

When editing block content, preserve valid block structure and existing unrelated text. A link inside a button, image, or reusable element may need a different edit from a paragraph.

Save draft changes for review or use the site’s approved update process. Keep the original content or revision so the edit can be inspected.

Repair a paragraph link in the block editor

  1. Open the exact post from the issue record and select the linked words.
  2. Click the link control or press Ctrl+K on Windows/Linux or Command+K on macOS.
  3. In the link preview, choose the pencil to edit the destination. Search for the intended internal post or enter the verified full HTTPS URL.
  4. Confirm the new destination, save through the appropriate draft/update workflow, and preview the article.
  5. Follow the saved link and inspect the final page after redirects. Recheck its meaning as well as its response code.
Selected text with a WordPress link preview and edit, unlink, and copy controls
Official WordPress link-editing documentation screenshot. The pencil edits the destination; the broken-chain control removes the link.

The screenshot shows the edit, unlink, and copy controls. Unlink removes the hyperlink while preserving its text; use it when the sentence should remain but no suitable destination exists. Buttons and shared templates need their own corresponding editor controls.

Verify the repair and prevent repetition

Recheck the source page and new destination. Confirm the visible anchor text still describes where the reader will go and that the link is usable by keyboard.

Run the same checker against the affected pages. Compare the findings with the original report and investigate any remaining ambiguity.

For a batch operation, keep a manifest of post IDs, original URLs, replacements, and completion status. Read back the saved content rather than treating a successful request as final proof.

Use recurring editorial review for important evergreen guides. The useful role of AI is helping interpret and repair findings with context; the availability check itself still needs real network evidence.

Example: repair an outdated documentation link

Suppose a tutorial links to an old plugin guide that now redirects to a general help homepage. The request succeeds technically, but the reader no longer reaches the instructions the sentence promises.

Record the source article and exact anchor text. Search the official documentation for the current equivalent, open it, and confirm that it covers the same version and procedure.

If the replacement now describes a different workflow, update the surrounding instructions as well as the link. Replacing the URL alone could make the passage less accurate.

If the destination returns a temporary error, repeat the check later and inspect it in a normal browser before deciding it has been removed permanently. Keep temporary failures separate from confirmed obsolete references.

After saving, click the link from the public source page and compare the checker’s result. Confirm that the article still explains the task correctly.

Written by

Previous story
Next story

Leave a Reply

Your email address will not be published. Required fields are marked *