WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by hivedigital v1.8

Canonical Attachments

Get more information from analytics and higher rankings by utilizing canonical http headers in htaccess for non image media attachments like pdfs.

Canonical Attachments

The facts

Rating
3.7★ from 3
Active installs
300+
Price
Free
Last updated
25 Aug 2025
Added
Jan 2017
Requires WP
4.5.1
Tested up to
WP 6.8.8
Downloads
7,722

Our analysis

AI-assisted

Canonical Attachments is a WordPress plugin designed to manage canonical tags for attachment files like PDFs and documents. It generates an htaccess file to handle these files in the wp-content/uploads directory and updates it with canonical tags delivered via HTTP headers when the attachments are accessed. The plugin also provides a dashboard for filtering attachments without canonical tags and allows users to attach files to their parent posts or manually manage canonical tags.

This plugin is useful for website owners who want to improve their SEO by ensuring that search engines index the correct URLs for their attachment files. By doing so, it helps track user traffic more effectively and encourages search engines to prioritise the main content pages over standalone attachment files.

Best for: Website owners looking to optimise SEO for attachment files.

What it does well

  • Generates htaccess file for managing attachments
  • Updates htaccess with canonical tags via HTTP headers
  • Provides a dashboard for managing attachments and canonical tags
  • Allows bulk attachment of files to parent posts
  • Enables direct editing of the htaccess file

Where it falls short

  • Limited information on future features and updates
  • No details on compatibility with non-Apache servers

Verdict

Canonical Attachments offers a specific solution for managing canonical tags on attachment files, which can be beneficial for SEO. However, the plugin may require further development to enhance its functionality.

From the developer

hivedigital's own description of Canonical Attachments, lightly tidied.

This plugin was developed to allow canonical tags as response headers to be created via htaccess for attachment files such as pdfs and docs.

The plugin:

  • Generates an htaccess file to manage the wp-content/uploads directory where these files are being uploaded
  • Updates the htaccess file with canonical tags which are delivered via a header when the attachment is called
  • Creates a dashboard where you can easily filter and find attachments without canonicals or that are not attached to a post.
  • Creates a dashboard where you can easily attach a file to its parent post (one at a time or in bulk) or manually add/remove a canonical tag for a file
  • Allows you to add a canonical url from the media file in the library or when you upload
  • Creates a dashboard to edit the .htacess file directly for the uploads directory in case there are additional files in the directory that were uploaded outside of wordpress (e.g. during a site migration)

The challenge: Analytics software such as Google Analytics, cannot track a user that enters a website via a pdf file in Google search results. Files cannot have a standard canonical tag added in the <head> and instead the canonical tag has to be added via an http header when the file is requested from the server. In order to accomplish this, we need to have an htaccess file listening for a request to that file, and then sending the header.

Expected outcome: PDF files and other attachments will be replaced in search results with the post or page counterparts, and we will be able to measure the traffic to those pages and provide calls to action for downloading the file, submitting contact forms, etc. Note: Canonical tags do not force a search engine to index one url vs. another, but act as a guideline/request to the search engine. As long as the attachment content is similar to the canonical URL, you should have no problem encouraging the search engines to choose the correct version.

Future Features and Development

Based on the feedback, we hope to continue developing additional features to support user requests. Current future feature ideas include:

  • Automatic canonicalization of non-image files to attached post
  • Integration with non-apache servers
  • Canonical builder for non-wordpress media files
  • Option to bulk delete canonical associations and delete htaccess on uninstall

Read the full description on the official page →

Tagged as

Alternatives

Other plugins for measuring traffic.

Under Construction

Easy to use Under Construction Page &amp; Coming Soon Page. Enable Under Construction Mode in seconds &amp; sh...

Free 600k+ installs 4.8★ (1,285)
Ad Inserter

Manage Google AdSense ads, banners, ad rotation, sticky widgets, AMP ads, ads.txt, tracking, header and footer...

Free 300k+ installs 4.9★ (2,428)
MonsterInsights

The best free Google Analytics plugin for WordPress. See how visitors find and use your website so you can gro...

Free 2M+ installs 4.5★ (3,148)
Maintenance

Great looking maintenance, coming soon &amp; under construction pages. Put your site under maintenance in minu...

Free 1M+ installs 4.4★ (860)
Header Footer Code Manager

Easily add tracking code snippets, conversion pixels, or other scripts required by third party services for an...

Free 600k+ installs 4.9★ (309)
GA Google Analytics

Adds Google Analytics tracking code to your WordPress site. Supports many tracking features.

Free 400k+ installs 4.9★ (158)