WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Samuel Aguilera v1.1.2

Attachment Pages Redirect

Redirect attachment pages or return a 404 error for them based on the parent post status.

Attachment Pages Redirect

The facts

Rating
4.9★ from 47
Active installs
10k+
Price
Free
Last updated
16 Jan 2026
Added
May 2012
Requires WP
4.8
Tested up to
WP 6.9.7
Requires PHP
5.6
Downloads
184,553

Our analysis

AI-assisted

Attachment Pages Redirect is a WordPress plugin designed to manage attachment page redirects based on the status of their parent posts. It automatically issues redirects or returns a 404 error when visitors land on attachment pages, depending on whether the parent post is available, deleted, or in the trash.

This plugin is suitable for users who want to ensure that visitors are directed to relevant content instead of encountering dead ends on attachment pages. It requires no configuration, as it activates and operates automatically upon installation.

Best for: This plugin is best for WordPress site owners who manage a lot of media attachments and want to improve user navigation.

What it does well

  • Automatically redirects visitors based on parent post status
  • Issues 301 or 302 redirects as needed
  • Returns a 404 error for trashed posts to avoid loops

Where it falls short

  • No options page for configuration
  • Only works if the attachment page exists

Verdict

Attachment Pages Redirect provides a straightforward solution for managing attachment page redirects, but it may not suit users looking for extensive configuration options.

From the developer

Samuel Aguilera's own description of Attachment Pages Redirect, lightly tidied.

There are three possible scenarios where this plugin does something. In all cases, the attachment page must exists, the plugin will not run for deleted attachments:

A) A visitor lands on an attachment page and the parent post is available (not in trash or deleted). A 301 redirect will be issued to redirect the visitor to the parent post.

B) A visitor lands on an attachment page and the parent post was already deleted from trash. A 302 redirect is issued to home page (this can be changed to 301 if you want, see FAQ for more details).

C) A visitor lands on an attachment page and the parent post is in trash, therefore not available for the visitor. It returns a 404 error code to prevent endless redirection loop in old WP releases and redirecting to trashed/not available posts.

There is no options page, simply activate it and will do the job.

If you’re happy with the plugin please don’t forget to give it a good rating, it will motivate me to keep sharing and improving this plugin (and others).

Requirements

  • WordPress 4.8 or higher.

Read the full description on the official page →

Tagged as

Alternatives

Other plugins for managing URLs.

All in One SEO

AIOSEO is the WordPress SEO plugin. Boost SEO rankings with AI SEO tools, schema, meta descriptions, XML sitem...

Free 2M+ installs 4.7★ (5,201)
301 Redirects

Manage 301 & 302 redirects. Simple redirection & redirects validation. Includes redirect stats & 4...

Free 300k+ installs 4.7★ (578)
Redirection for Contact Form 7

Redirect to any page or URL, execute scripts after submission, save data to the database, and unlock additiona...

Free 200k+ installs 4.7★ (275)
Permalink Manager Lite

Permalink Manager enhances WordPress’s built-in URL system, allowing you to change the URLs of native and cust...

Free 100k+ installs 4.8★ (176)
WP Encryption

Lifetime SSL solution - Free SSL certificate & HTTPS redirect, fix insecure site / SSL errors, Security he...

Free 50k+ installs 4.9★ (1,143)
Redirection

Manage 301 redirects, track 404 errors, and improve your site. No knowledge of Apache or Nginx required.

Free 2M+ installs 4.4★ (703)