Skip to content

How to stop WordPress attachment pages from being indexed

SEO1 min readFixes check wp-attachment-pages-indexed

WordPress creates a page for every uploaded image. Redirect them to the file or the parent post so they do not dilute the index.

Step by step, with screenshots: Rank Math settings we recommend (and the modules to leave off) →

Check your own site

Runs this check and the other 186, free, in about 45 seconds.

What a passing site looks like

  • Attachment pages are not exposed to search engineswarning · −1 ptseffort S

WordPress attachment pages

Why it matters. WordPress creates a bare page for every uploaded image. Hundreds of them in the index dilute the site with pages that hold nothing but a picture.

How to fix it.
  1. In Yoast SEO, under Settings, Advanced, Media pages, enable the redirect of attachment URLs to the file itself; in Rank Math set Media to noindex or redirect.
  2. Without an SEO plugin, add a redirect from attachment pages to the parent post in your theme or a redirect plugin.

Filed under WordPress & WooCommerce. Copy is generated from the same catalogue that scores every report, so what you read here is what the report says.