BACK TO DIRECTORY

Attachment Pages Redirect

by Samuel Aguilera

4.9
(47 ratings)

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.

Plugin Details

Active Installs
10K+
Total Downloads
185,001
Version
1.1.2
Requires WP
4.8
Requires PHP
5.6
Tested Up To
6.9.7
Added
2012-05-16
Last Updated
2026-01-16 11:00am GMT

Ratings

5
45
4
1
3
0
2
0
1
1