DEV Community

Sandeep Singh
Sandeep Singh

Posted on

How to Audit Internal Links on a WordPress Site

Internal links are the roads inside your website. They're how visitors move from a blog post to a product or service page, how they find related content, and how search engines discover and understand your pages. Google's own guidance says it plainly: "Every page you care about should have a link from at least one other page on your site" (Link best practices).

WordPress sites are especially prone to internal link problems because they grow over years. Posts get updated, slugs change, categories get reorganised, plugins come and go, themes get swapped, and the site gets moved between hosts or from staging to production. Each of those leaves some links pointing somewhere they shouldn't.

The result is lost traffic you never see: a reader following "read my full guide" hits a 404 and leaves, a high-converting landing page has no links pointing to it so nobody finds it, and search engines spend their time on redirects instead of your content.

This guide walks through a full internal link audit using free tools, then shows how to fix problems at the source rather than piling up redirects.

What you're looking for

An internal link audit checks for six things:

  1. Broken internal links: links to pages on your own site that return 404 or another error.
  2. Redirected internal links: links that work but go through one or more redirects first.
  3. Orphan pages: published pages that no other page links to.
  4. Deeply buried pages: important pages that take many clicks to reach from the homepage.
  5. Weak anchor text: "click here" and "read more" instead of descriptive text.
  6. Leftover URLs: links to your staging domain, http:// versions or old domain.

Step 1: Crawl the site

You need a full list of every internal link: the page it's on, where it points and what status that target returns. Some free options:

  • Screaming Frog SEO Spider (free up to 500 URLs; limits). Enter your homepage and crawl. Use Response Codes to filter internal URLs by status, and the Inlinks tab at the bottom to see every page that links to a selected URL, with anchor text.
  • The Broken Link Checker plugin (WordPress.org) checks links from inside WordPress and lets you edit or unlink from its dashboard. Plugin-based checkers use your server's resources, so check its settings on shared hosting.
  • Google Search Console's Links report shows your most internally linked pages from Google's point of view. It won't show broken links directly, but it's a useful sanity check.

A crawler that starts from your homepage only finds pages reachable by links. That's exactly what you want for steps 2–5, and it's why orphan pages need a separate check in Step 4.

Step 2: Fix broken internal links

Filter the crawl for internal URLs returning 4xx and 5xx. For each one, open Inlinks to see which posts or pages contain the bad link.

Common causes on WordPress:

  • A post slug was changed. WordPress core tries to rescue some of these: its wp_old_slug_redirect() function attempts to find a post's current slug from past slugs and redirect (WordPress developer reference). That doesn't cover every case, such as pages, custom post types on some setups, or posts that were deleted and recreated.
  • The permalink structure was changed in Settings → Permalinks (WordPress docs). Links hard-coded in old content keep the old format.
  • A page was deleted or unpublished.
  • A plugin that created pages was removed: shop, events, forums, landing page builders.
  • Category or tag base changed, breaking every category link in old posts.
  • Typos in manually entered links.

Fix the link in the content where it appears: edit the post, menu or widget and point it at the correct current URL. If the destination genuinely no longer exists, either link to the best replacement or remove the link.

Step 3: Update redirected internal links

Next, filter for internal links returning 3xx. These work, but every redirect is an extra request before the page loads. Lighthouse notes each redirect can delay a page "by hundreds of milliseconds" (Avoid multiple page redirects), and chains make it worse.

Typical WordPress sources:

  • Links to http:// versions of your own pages, redirected to https://
  • Links to www when the site lives on the bare domain (or the reverse)
  • Links missing the trailing slash, redirected to add it
  • Old slugs being rescued by a redirect plugin

Redirects are the right tool for external links and old bookmarks. For your own internal links, update the link to the final URL so visitors and crawlers get there directly. If you're seeing chains or loops, I covered fixing those in Redirect Chains and Loops: What They Cost an Ecommerce Site and How to Fix Them, and Mixed Content and Missing Images: A Practical Fix Guide for Store Owners covers the related http:// asset problem.

Bulk-fixing domain and protocol changes

If thousands of links point at an old domain or http://, editing posts by hand isn't realistic. WP-CLI's search-replace handles it, including serialized data in options and widgets:

# Always preview first, and take a database backup
wp search-replace 'http://example.com' 'https://example.com' --dry-run
wp search-replace 'https://staging.example.com' 'https://example.com' --dry-run
Enter fullscreen mode Exit fullscreen mode

Remove --dry-run only after checking the counts look right. Many hosts and migration plugins offer a similar search-and-replace tool if you don't have shell access.

Step 4: Find orphan pages

An orphan page is published but not linked from anywhere on the site. A link-following crawler can't find it, and visitors are unlikely to either.

To find them, compare what you've published with what the crawler found:

  1. Get the list of published URLs from your XML sitemap. Since WordPress 5.5, core generates a sitemap index at /wp-sitemap.xml (Make WordPress Core); SEO plugins often replace it with their own, usually at /sitemap_index.xml.
  2. Export the list of HTML URLs your crawler found by following links.
  3. Anything in the sitemap but not in the crawl is an orphan.

A spreadsheet works for this: paste both lists into separate columns and use a lookup to flag sitemap URLs missing from the crawl.

For each orphan, decide:

  • Still valuable? Link to it from relevant posts, a category page or a hub page.
  • Outdated or thin? Update it, merge it into a stronger page (and redirect), or unpublish it.
  • Intentionally hidden (a thank-you page or a campaign landing page)? Consider whether it should be in the sitemap at all, or whether it should carry noindex.

Step 5: Check click depth for important pages

Most crawlers report crawl depth: how many clicks from the homepage each page is. Your most important pages (key services, best guides, top products) shouldn't be buried at depth 5 behind pagination.

Ways to bring them closer:

  • Link to them from the main menu or a footer section
  • Create a hub or "start here" page linking to your best content
  • Add contextual links from related, popular posts
  • Use breadcrumbs (many themes and SEO plugins provide them)

Step 6: Improve anchor text

Google says good anchor text "is descriptive, reasonably concise, and relevant to the page that it's on and to the page it links to", and that it helps "both people and Google make sense of your site" (Link best practices).

In the crawl's Inlinks or All anchor text export, look for:

  • Generic text: "click here", "read more", "this post", "here"
  • Empty anchors, such as image links with no alt text
  • The same exact keyword phrase used for every link to a page, which reads awkwardly

Rewrite them as natural descriptions: "see our guide to [choosing a running shoe]" rather than "[click here] for our guide".

Step 7: Check your theme and page builder output

Two WordPress-specific issues to verify:

  • Links must be real <a href> elements. Google says it can generally only crawl links that are <a> elements with an href attribute (Link best practices). Some page builders and theme widgets render buttons or "clickable boxes" with JavaScript onclick handlers instead. View the source of a few pages and check that menus, buttons and cards are real links.
  • Related-posts and widget links. These are generated automatically and can point at drafts, trashed posts or attachment pages. Check them in the crawl, too.

Step 8: Make it a habit

A one-off audit fixes today's problems. WordPress sites keep changing, so links keep breaking. A sustainable routine:

  • After every significant change (theme switch, permalink change, plugin removal, migration): crawl and fix.
  • Monthly: a quick crawl filtered for 4xx and 3xx internal links.
  • Quarterly: the orphan-page and anchor-text review.

The Website Maintenance Checklist for Small Business Websites puts internal link checks in context alongside backups, updates and renewals.

Disclosure: I build Uchik, which automates the recurring part. Uchik crawls your site every day and emails a report of broken internal and external links, missing images, redirect chains and HTTPS problems, each with the source page and the exact HTML element to fix. It runs as an external crawler, so there's no plugin to install or keep updated. The features page lists every check, the sample report shows the output, and the FAQ explains its limits, including that links added only by JavaScript may be missed. It doesn't do the orphan-page comparison in Step 4; keep that in your quarterly review. You can sign up for free.

Checklist

  • [ ] Full crawl from the homepage
  • [ ] Broken internal links fixed at the source
  • [ ] Redirected internal links updated to final URLs
  • [ ] Old domain, staging and http:// links bulk-replaced (with backup and dry run)
  • [ ] Sitemap vs crawl compared; orphans linked, merged or removed
  • [ ] Important pages within a few clicks of the homepage
  • [ ] Generic anchor text rewritten
  • [ ] Menus, buttons and cards confirmed as real <a href> links
  • [ ] Recurring check scheduled or automated

Internal links are the one part of your site's linking you fully control. A few hours of auditing keeps readers and crawlers moving to the pages that matter.

Top comments (0)