What Are Media Attachments and Should I Submit Them to Search Engines?

We often get asked about whether to include Media Attachments in the XML Sitemap or whether to set them to NOINDEX. 

This article will address questions related to Media Attachments and how they affect your site SEO.

What Is A Media Attachment?

A Media Attachment is a type of content that is built into WordPress. It's a special page that displays a media item, such as an image, along with some additional information.

When you add a media item to your content, you have the option to link the media item to its Attachment Page as shown in the screenshots below:

Linking to an Attachment Page in the Classic Editor
Linking to an Attachment Page in the Classic Editor
Linking to an Attachment Page in the Block Editor
Linking to an Attachment Page in the Block Editor

When a visitor clicks on the image, they are taken to the Attachment Page which displays the image title, the image, a caption and/or description (if set), and the comments form (if comments are enabled).

How Would I Use Attachment Pages?

Because an Attachment Page is a standard WordPress post type, it has a theme template file that allows you to control what content is displayed and how it looks.

A good example of this would be a photography theme that uses the Attachment Page to display EXIF data for the photo, such as the make and model of the camera, and the camera settings (ISO, Exposure, Shutter Speed, etc). It could also display geographical information of where the photo was taken.

What Are The SEO benefits?

For most sites there are no SEO benefits from Media Attachments. This is because these pages have little to no content on them, they just show the image title, the image itself and that's all. Why would a visitor want to visit or search for this page? Answer: they wouldn't!

However, some sites will use Media Attachments to display rich content about the image, such as our example above of a photography site. In this case, you probably want visitors to be able to find this content in search engines. The rich content on these pages could be valuable for your ability to rank for specific terms, and therefore there is great benefit in terms of your overall site SEO.

What Should I Do?

If your Media Attachments contain no rich content, then you should click on Search Appearance in the All in One SEO menu and then click on the Image SEO tab.

Search Appearance in the All in One SEO menu

You’ll see the first setting is Redirect Attachment URLs.

Redirect Attachment URLs in All in One SEO

Set this to either Attachment or Attachment Parent as described below:

  • Attachment – This will redirect media attachments to the image itself. In other words, if someone was to click on the URL for a Media Attachment, they would be redirected to the image instead
  • Attachment Parent – This will redirect media attachments to the page where the image is embedded. In other words, if someone was to click on the URL for a Media Attachment, they would be redirected to the page where that image is found. If in doubt, choose this option.

However, if your Media Attachments contain rich content that visitors would want to find in search engines, then set Redirect Attachment URLs to Disabled.

You should now see the Show in Search Results setting and this should be set to Yes.

Won't This Affect Indexing Of My Images?

No, this has no effect on images. This only affects Media Attachments.

Images will still be included in the XML Sitemap provided you don't check the Exclude Images setting.

We often get asked about whether to include Media Attachments in the XML Sitemap or whether to set them to NOINDEX.

This article will address questions related to Media Attachments and how they affect your site SEO.

What Is A Media Attachment?

A Media Attachment is a type of content that is built into WordPress. It's a special page that displays a media item, such as an image, along with some additional information.

When you add a media item to your content, you have the option to link the media item to its Attachment Page as shown in the screenshots below:

Linking to an Attachment Page in the Classic Editor
Linking to an Attachment Page in the Classic Editor

Linking to an Attachment Page in the Block Editor
Linking to an Attachment Page in the Block Editor

When a visitor clicks on the image, they are taken to the Attachment Page which displays the image title, the image, a caption and/or description (if set), and the comments form (if comments are enabled).

How Would I Use Attachment Pages?

Because an Attachment Page is a standard WordPress post type, it has a theme template file that allows you to control what content is displayed and how it looks.

A good example of this would be a photography theme that uses the Attachment Page to display EXIF data for the photo, such as the make and model of the camera, and the camera settings (ISO, Exposure, Shutter Speed, etc). It could also display geographical information of where the photo was taken.

What Are The SEO benefits?

For most sites, there are no SEO benefits from Media Attachments. This is because these pages have little to no content on them, they just show the image title, the image itself and that's all. Why would a visitor want to visit or search for this page? Answer: They wouldn't!

However, some sites will use Media Attachments to display rich content about the image, such as our example above of a photography site. In this case, you probably want visitors to be able to find this content in search engines. The rich content on these pages could be valuable for your ability to rank for specific terms, and therefore there is great benefit in terms of your overall site SEO.

What Should I Do?

If your Media Attachments contain no rich content, then you should set them to NOINDEX by going to All in One SEO » General Settings » Noindex Settings and check the box for Media / Attachments in the Default to NOINDEX setting.

You should then go to All in One SEO » XML Sitemap and uncheck the box for Media / Attachments in the Post Types setting. This will ensure that these pages are not submitted to search engines and that search engines are instructed not to index them.

However, if your Media Attachments contain rich content that visitors would want to find in search engines, then you should make sure that Media / Attachments are included in your XML Sitemap and that they are not set to NOINDEX.

You should then go to All in One SEO » General Settings » Content Type Settings and ensure that Media / Attachments is checked in the SEO on only these Content Types settings. You should then to go the Media Library and set a unique SEO Title and SEO Description for each image in the All in One SEO section.

Won't This Affect Indexing Of My Images?

No, this has no effect on images. This only affects Media Attachments.

Images will still be included in the XML Sitemap provided you don't check the Exclude Images setting.

Images will still be indexed provided the search engine feels that there's a benefit to including your images in their image search results. Search engines such as Google may not index any or all of your images, so don't be surprised if your images don't appear in their image search.