Are you aware of the fact that whenever you upload a file to the WordPress Media Library, WordPress creates a separate media attachment page for every individual file? This page has its own automatically generated URL and comprises only the media content.
This page is not very useful most of the time unless you’ve dedicated photography or artwork or a graphic design website, where you would need to showcase your individual works.
If you’re a standard WordPress user, you might want to redirect WordPress attachment pages to the original post or the page, where the file was attached to.
In this knowledgebase article, we’ll discuss whether you should enable the Redirect Attachments option on your website.
Why You Should Redirect the WordPress Attachment Pages?
If you choose not to redirect the WordPress attachment pages, then it will have a bad impact on SEO. For example, if you create a post with two images in it. Then WordPress will automatically create three URLs, two for the images and one for the original post. This ultimately hurts your SEO in more than one way, including but not limited to:
- Google might bring in the much-needed traffic to the attachment pages instead of the original post. This is something that you would definitely want to avoid similar to 404 errors.
- The audience that lands upon the image or the attachment page tend to move away from it as the page only includes image and practically “thin content“. Eventually, this would increase the bounce rate.
- It is also possible that Google might index all your image files and consider them to be duplicate content.
- There could be instances where media added to a restricted page could be indexed on search engines with their attachment URLs. In this case, any unverified user might get access to the media of the page by simply clicking through the URL in the search result without the password.
Considering these cases, it is safe to redirect your attachment pages and offer a rich experience to your users.
How to Redirect Attachments With Rank Math?
To redirect these attachments with Rank Math, you can head over to Rank Math SEO → General Settings → Links inside your WordPress dashboard. Here you can find the Redirect Attachments option. In case if this option isn’t available for you, make sure that you’re using the Advanced mode of Rank Math.
Enable the Redirect Attachments option and then click the Save Changes button at the bottom of the page. Now you can check the attachment pages if they are redirected to the post or page they belong to. You can also redirect your attachment pages directly to the media URLs by following this tutorial.
Please note that Rank Math will redirect your media to the post or page only if they are uploaded on a post or page. Instead, if they were uploaded directly to the WordPress Media library, then they would remain unattached (orphan attachments). Inside your WordPress Media Library, you can do a quick check to filter the Unattached media items, as shown below.
Rank Math has got an option to help you redirect these orphan attachments to a specific URL. The option to Redirect Orphan Attachments would appear only if you’ve enabled the Redirect Attachments option earlier.
By default, this option is set to your homepage, and all your orphan attachments will be redirected to your website’s homepage. You may decide to change this setting with any URL of your choice. But leaving this setting blank would result in no redirection for orphan attachments, and they can be accessed through their attachment pages.
And, that’s it. We hope the article helped you make a decision on redirecting attachments. If you still have absolutely any questions, please feel free to reach our support team directly from here, and we’re always here to help.