Remove Links to Image Attachment

Posted in Wordpress

This plugin removes all links to sub-post attachments from posts, setting the attachment link to the post’s permalink.  This has a very narrow use case, primarily if you have set up your blog with date-based archives and since migrated to a “pretty” permalink structure.  This will NOT work if you are using multi-page posts, and in fact, will cause errors with your site structure.  Fair warning :)

 

Download here: Remove Links to Image Attachment

 

While there are a myriad of WordPress plugins available that will redirect pages with “attachment” in the permalink structure, I wasn’t able to find a solution for legacy post attachments which do not contain the word “attachment” in the permalink structure.  Hence the existence of this plugin :)

 

For example, let’s say your old permalink structure was something similar to:

http://lawyernomics.avvo.com/2012/8/some-example/

 

Depending on how long you have been running WordPress, accordingly, your image attachment pages would be something along the lines of:

http://lawyernomics.avvo.com/2012/8/some-example/image-name/

 

Newer version of WordPress would have the image attachment URL as follows (and should use this plugin):

http://lawyernomics.avvo.com/2012/8/some-example/attachment/image-name/