Orphan Pages in WordPress: How to Find and Fix Them
Three ways to find orphan pages in WordPress, from a database query to a crawl against your sitemap, then how to triage them and add links that count.
In this article 8 sections
An orphan page is a published page that no other page on your site links to. It can be in your sitemap and even in Google's index, yet no visitor browsing the site will reach it, and search engines get no internal signal about what it relates to or how much it matters. This guide shows three ways to find orphan pages on a WordPress site, from a rough database query to a full crawl, and how to decide what to do with each one.
Two definitions, and why the difference matters
People use "orphan" for two different conditions:
- Strictly orphaned: nothing links to the page at all. Not a menu, not an archive, not another post. The only ways in are the sitemap, an external link or a typed address.
- Editorially orphaned: no post or page mentions it in its text. It may still appear in a category archive or on page 14 of the blog index.
In WordPress, posts are rarely orphaned in the strict sense, because category, tag and date archives list every post automatically. But an archive link is a weak one. It sits among dozens of others, carries the post title as its only context, and moves deeper with every new post you publish. A post whose only inbound links come from archives is, for practical purposes, on its own.
Pages are different. A WordPress page appears nowhere unless someone links it, so pages are often orphaned in the strict sense: old landing pages, a pricing page from a retired plan, a policy page dropped from the footer in a redesign.
Decide which definition you are auditing for. The methods below find different things.
Method 1: a database query for a first look
If you have database access, one query gives a rough list of posts and pages whose slug does not appear in the content of any other published post:
SELECT p.ID, p.post_type, p.post_title
FROM wp_posts p
WHERE p.post_status = 'publish'
AND p.post_type IN ('post', 'page')
AND NOT EXISTS (
SELECT 1 FROM wp_posts s
WHERE s.post_status = 'publish'
AND s.ID <> p.ID
AND s.post_content LIKE CONCAT('%/', p.post_name, '/%')
);
Change wp_ to your table prefix. Treat the result as a starting point:
- It matches slugs as text, so a post with the slug
guidewill look linked if any content contains/guide/in another address. - It finds editorial orphans only. Menus and archives are not in post content.
- It scans the whole posts table for every row. On a site with thousands of posts, run it on a staging copy, not on the live database at a busy hour.
For a small site this is often all you need: twenty rows, most of them obvious.
Method 2: compare a crawl with your sitemap
This is the standard method for strict orphans, and it works on any site.
- List what should exist. Take every URL in your XML sitemap. That is your list of pages you want indexed.
- List what can be reached. Run a site crawler from the homepage and export every URL it found by following links.
- Subtract. URLs in the first list and not in the second are orphans: the crawler could not get to them.
A spreadsheet does the subtraction. Put both lists in columns and use a lookup to flag sitemap URLs that are missing from the crawl.
Two refinements make the result more useful:
- Add a third list from Search Console. Export the pages with impressions from the Performance report. An orphan that still gets impressions is worth rescuing first. A URL with impressions that is in neither the sitemap nor the crawl is an orphan you had forgotten existed.
- Look at click depth as well. Most crawlers report how many clicks each page is from the homepage. Pages at depth six or more are not orphans, but they share the problem.
Method 3: count inbound links where you edit
A crawl is a snapshot, and it goes stale the day after. The alternative is to keep a running count of which posts link to which, and look at it where you manage content.
Hydrogen SEO 0.0.30 does this on the WordPress Posts screen. Each published post shows three numbers in the SEO column, internal links out, external links out and posts linking in, and the All SEO filter has an Orphaned (no internal links in) option that lists every post no other published post links to. The counts update whenever a post is saved. It is free and needs no account; the details are in the internal link counter.
This finds editorial orphans, the same kind as the database query, without the false matches and without rerunning anything. It does not see menus or archives, so pair it with a crawl once or twice a year if strict orphans matter to you.
Triage: not every orphan needs a link
Go through the list and put each page into one of four groups.
Keep and link. The page is accurate, useful and should be found. This is the group to spend time on.
Merge. The page covers something a stronger page also covers. Move anything worth keeping into the stronger page and add a 301 redirect from the weaker address.
Redirect or remove. The page is out of date and has no successor worth merging into. If other sites link to it or it still gets visits, redirect it to the closest relevant page. If not, unpublish it and let the address return a 404. Redirecting everything to the homepage helps nobody; see 301 vs 404.
Orphaned on purpose. Thank-you pages, campaign landing pages reached from adverts, pages sent to one customer. These should not be linked. If they also should not be found in search, give them a noindex and leave them.
How to link an orphan properly
Adding one link from the footer clears the page from the report and changes almost nothing. A useful internal link has three properties:
- It comes from a related page. Search your own site for the orphan's topic. On WordPress, the search box on the Posts screen is enough: search for the main phrase and open the posts that mention it.
- It sits in a sentence, with descriptive anchor text. "See our guide to descaling a kettle" tells readers and search engines what is behind the link. "Click here" does not.
- It comes from a page that itself gets visited. A link from your most-read post on the subject is worth more than five from posts nobody opens.
Two or three such links per orphan is a sensible target. If you cannot find a single related post to link from, ask whether the page belongs on the site, or whether the site is missing the content that would surround it.
For pages, also consider structure: a parent page, a hub page for the topic, or the menu if the page is important enough.
Keep new orphans from appearing
Orphans are produced by routine, so the fix is a routine:
- When you publish, link in as well as out. Before a new post goes live, edit two older posts to link to it. This is the single habit that prevents most orphans.
- When you remove a menu item or redesign navigation, list the pages that lose their only link.
- When you delete or unpublish a post, check what it linked to. Its targets may have just lost their last inbound link.
- Review monthly. Ten minutes with the orphan list catches the month's new entries while you still remember what they were for.
Common questions
Can an orphan page rank? Yes, if Google knows the address from a sitemap or an external link. It usually ranks below where it would with internal links, since nothing on your site vouches for it.
Does being in the sitemap fix it? No. A sitemap tells search engines the page exists. It says nothing about how the page relates to the rest of the site, and visitors do not browse sitemaps.
How many internal links should a page have? There is no number. Every page you want found should have at least a few links from related content, and your most important pages should have the most.
Further reading: the orphan page glossary entry, and our internal linking strategy for the wider picture.