Do not delete an image just because its WordPress attachment page looks thin. First distinguish the HTML attachment page from the media file and the article using it. Then decide whether the page deserves to remain a useful destination, should lead to a relevant alternative or should be excluded from search under a deliberate policy.
There is no safe universal rule that every attachment URL must redirect to the homepage. The right action depends on the page's purpose, existing traffic or links, technical behavior and the destination a visitor actually needs. This guide provides a small, reversible audit before any sitewide setting change.

Understand the three different objects
An uploaded photograph can be a file in the Media Library, appear inside several articles and also have an attachment-page address. The HTML page and the file are not interchangeable objects. Removing the underlying file can break published articles even if you only meant to change an extra page.
| Object | What a visitor gets | Question to ask |
|---|---|---|
| Media file | The image, PDF or other uploaded asset | Does the asset remain available where it is used? |
| Attachment page | An HTML destination associated with the asset, when enabled | Does this page offer useful standalone context? |
| Containing article | Editorial content that embeds or links to the asset | Is this the useful destination for the visitor's task? |
A photographer may intentionally provide a page discussing one work. A business blog may have only an automatically generated wrapper around a decorative image. Those two situations should not receive the same decision merely because WordPress calls both attachments.
Check actual behavior, not an old tutorial's assumptions
WordPress's core developer note explains that, from version 6.4, new installations disable attachment pages by default and redirect them to the media file. Existing installations preserved their enabled behavior on upgrade. The documented option is wp_attachment_pages_enabled. Plugins and site configuration can add another layer, so inspect what your own site currently does.
Do not conclude that every site running a recent WordPress version already behaves identically. Nor should you assume a tutorial describing automatic public pages reflects a newer site's defaults. A short live-response test is more reliable than a version-based guess.
Sources, research method and boundaries
The core behavior and plugin controls discussed here were checked against first-party WordPress and Rank Math documentation on October 17, 2026. The decision matrix and trace record are an editorial framework. No sitewide redirect experiment, ranking gain or indexing reduction is claimed.
This guide concerns HTML attachment-page policy. It is not an instruction to hide all images from Google, remove copyright notices or delete unused-looking files. For the wider website foundation, see the WordPress SEO setup guide.
Step 1: build a representative URL inventory
Start with several attachments rather than thousands of assumed URLs. Include an older upload, a recent upload, an asset attached to a post, an unattached Media Library item and any attachment destination known to receive search visits or external links.
For each sample, record the media ID, HTML attachment URL if available, direct file URL, known articles using it, parent association and current response. Add the actual final destination after redirects. Keep the record private if it includes unpublished or restricted material.
Do not generate attachment URLs from filenames alone. Obtain the actual address from WordPress or an authorized crawl. A guessed URL that returns 404 does not prove the real attachment page is absent.
Check image use before considering any deletion
A Media Library item's association is not a complete inventory of every place the file appears. Ask the editor or developer to check page content, templates, reusable elements and other relevant uses. If a file is important to a public article, preserve that dependency throughout the page-policy change.
Deleting media is a separate, potentially destructive task. It should require its own exact target list and approval, not be an accidental side effect of an SEO cleanup.
Step 2: evaluate the page as a destination
Open each HTML page as a visitor. Does it explain the asset, credit its creator, provide meaningful context or support a distinct task? Is the title intelligible? Can the visitor find the relevant next step? A word count by itself cannot answer these questions.
Use existing evidence where available: search queries, landing-page visits, referral links and editorial intent. A low-traffic page might still serve a legitimate archive function. Conversely, a page with a title and image but no useful context may not deserve to be a separate search destination.
| Situation | Possible decision | Condition to verify |
|---|---|---|
| Original artwork page with substantive context | Keep and maintain | The page fulfills a distinct useful task |
| Wrapper whose useful context is in one article | Consider a relevant redirect | The chosen article actually explains this asset |
| Intentional public utility page, not a search destination | Consider indexing exclusion | Access remains appropriate and the rule is correctly delivered |
| No relevant replacement and no continuing purpose | Review retirement separately | Dependencies, existing links and business intent are understood |
| Private information exposed | Escalate access protection | Privacy is handled as more than an indexing setting |
This matrix offers decisions to review, not a bulk action order. Document the reason for each class before applying a shared rule. A homepage is not automatically a useful replacement for a specific asset page.
Step 3: identify which layer controls the response
Inspect the core setting, SEO-plugin attachment controls and any explicit redirect rules with the technical owner. Do not edit the database directly just to find out what a checkbox does. Record the current configuration and response first.
Rank Math documents Redirect Attachments under General Settings → Links, with Advanced mode needed for some controls. Its parent-page behavior and separate orphan-attachment setting require different checks. Do not infer that an unattached item will automatically find the editorial destination you would have chosen.
When several components could redirect the same address, the final observed response is the acceptance evidence. A manually entered rule can exist without controlling the actual request. Ask the developer to identify the responsible layer before adding another plugin or overlapping rule.
Step 4: make a small, reversible change
- Obtain approval for the exact page class and intended behavior.
- Capture the current settings and a backup or supported rollback path.
- Test on a representative protected staging copy where possible.
- Apply the narrowest supported configuration change.
- Fetch the old HTML attachment address and follow its destination.
- Open the direct media file and the containing article separately.
- Confirm that unrelated attachment classes remain as intended.
- Record pass, failure or an unresolved exception before expanding.
A setting that changes all attachments is broader than a rule for one page. If the site contains intentional standalone galleries or artwork pages, a global toggle may not fit. Stop and design a scoped policy with the developer instead of treating those useful pages as acceptable collateral damage.
A worked example: a diagram used by a service article
Imagine a Pakistani agency blog containing a process diagram. The diagram is embedded in a detailed guide and also has an older HTML attachment page showing little beyond the image and filename. This is a hypothetical scenario, not a measurement from a client site.
The editor confirms that the guide is the meaningful destination and that the image is used on two other pages. The team records the attachment address, image file and all three article references. They decide to direct visitors from the wrapper to the guide, while keeping the image file intact.
After the approved change, the old wrapper reaches the intended guide. The direct WebP still loads, and the three articles still display it correctly. A second sample, an original illustration portfolio page with substantive commentary, remains available under its separately approved policy.
The useful outcome is a coherent visitor journey with preserved assets—not a smaller Media Library count. The team does not describe this test as evidence of improved rankings.
Step 5: test the whole link journey
Review links generated by image blocks, galleries and templates. If a visitor clicks an image expecting a larger view, redirecting its attachment wrapper to an article may create an unexpected loop in their journey. The editor may need to link directly to the file or remove an unnecessary link, depending on the intended experience.
Use the internal linking guide to think about useful destinations rather than treating every link as a search signal. A click should deliver what its label or visual affordance reasonably promises.
Check sitemap references and any navigation pointing to retired wrappers. Avoid leaving old addresses as the site's preferred internal destinations when a clearer direct link exists. Keep this separate from deleting the media asset itself.
Common mistakes and troubleshooting
Every unattached item is sent to the homepage
Review whether that destination helps the visitor. A meaningful mapping requires understanding the asset's role. If there is no relevant replacement, do not manufacture relevance with a blanket homepage redirect.
The image disappears from published articles
Check whether someone deleted or moved the underlying file instead of changing the HTML page. Use the approved recovery path and test the exact file URL. An attachment-page policy should not require breaking legitimate embeds.
The new redirect creates a loop
Trace the actual request sequence and the rules responsible. Compare core, plugin and server behavior. Restore the known prior configuration if necessary, then make one scoped correction rather than stacking more redirects.
Only older uploads behave differently
Compare their current settings, parent associations and explicit rules. Do not assume upload age alone is the cause. Use enough samples to identify a reproducible class before applying a shared repair.
A restricted page has a public media URL
Treat the confidentiality requirement explicitly. A page redirect does not establish file-level access control. Escalate to the responsible owner and test anonymous file retrieval.
A reusable attachment audit record
Keep these columns: attachment ID, HTML URL, media-file URL, known usage, current final response, standalone value, existing search/link evidence, proposed policy, target if relevant, approval, test date, rollback and remaining exception.
For large sites, prioritize pages with known visits, links or important templates. Sampling reduces initial effort but does not prove every attachment behaves correctly. Expand the audit when results differ.
Frequently asked questions
Will disabling attachment pages remove my photographs?
The documented core behavior changes the page destination; it is not a command to delete the files. Still, verify the actual behavior of your configuration and test existing article embeds.
Should every attachment page be noindex?
No universal rule is appropriate. Decide whether the page has a useful standalone purpose, whether a relevant alternative exists and which controls fit that intention.
Does “unattached” mean unused?
Do not rely on that label as proof that no content references the file. Check actual use before a separate media-deletion decision.
Will this guarantee more traffic to my articles?
No. The defensible result is a better-defined URL policy and preserved visitor journey. Search effects require separate observation.
Conclusion
Audit the page, file and containing article as separate objects. Keep useful standalone destinations, map redundant wrappers thoughtfully and preserve the assets that published content needs. Test actual responses and visitor journeys before extending any setting across the site.
Need help applying this?
Get a practical review focused on the issue, evidence and next actions.
Contact Shahzaib