How to Make Sure Your Accessible PDFs Stay Accessible in WordPress

Imagine you have a dozen PDFs you plan to upload to the Resources page on your WordPress site.

You’ve tagged and optimized each PDF so it has

  • Searchable text
  • Document language
  • Document title
  • Proper reading order
  • Alternative text for non-text elements
  • Hyperlinks, headings, table of contents, and bookmarks for navigational aids

It’s taken several hours to make all the PDFs accessible.

You log in to your WordPress site, open your Resources page to edit, and select a PDF to add to the page.

To confirm it’s working and displaying correctly, you select the PDF link you added.

The PDF opens up, and you discover all the tags you’ve added to make the PDF accessible have been stripped out.

Argh!

That’s what happened recently to one of my colleagues, who contacted me about the issue and how it could be resolved.

After asking several questions about their process and setup, I discovered what happened.

Read on to learn what caused the issue and how it was resolved.

What Caused the Tags to be Stripped from the PDF

Troubleshooting a WordPress issue when you don’t have access to the site can be challenging.

Which is why I first asked questions about the WordPress site setup and the process used to upload the PDFs.

My colleague told me the site was using an image optimization plugin which optimizes and compresses media when it’s uploaded to the site.

Aha!

I recognized the issue. I suspected the plugin was the cause of the problem.

Plugins like ShortPixel and Imagify are powerful plugins that compress media without losing quality, providing faster display for pages with media.

Hundreds of thousands of WordPress users use image optimization plugins to optimize their media.

Which benefits everyone, especially people with limited bandwidth and slower Internet speeds.

But what many users of image optimization plugins may not be aware of is that accessible PDFs will have tags automatically stripped on upload.

Unless steps are taken to make sure PDFs aren’t compressed.

Neither ShortPixel nor Imagify mention the loss of accessible tags in their plugin description.

Which is frustrating since both plugins repeatedly mention PDF compression on their WordPress plugin repository page.

How to Maintain Accessible PDF Tags with ShortPixel and Imagify

If you’re using ShortPixel to optimize your images, PDFs are automatically compressed by default.

You need to specifically exclude PDFs from compression in ShortPixel’s settings.

If you’re using Imagify and have “Auto-optimize images on upload” setting enabled, PDFs are automatically compressed by default.

You’ll need to install the Imagify exclude PDF optimization helper plugin, only found in their GitHub repository.

Though the helper plugin was released in mid-2021, the Imagify helper plugin still has no documentation.

Unless you’re a developer, many WordPress users aren’t aware GitHub is used for plugins.

Personally, I don’t know why Imagify doesn’t:

  • Have documentation
  • Publish the helper plugin in the WordPress plugin respository, or
  • Make the PDF exclusion a setting within Imagify

Wrapping Up

No one wants to discover all their accessibility work disappears when they upload an accessible PDF to their WordPress site.

If you’re using ShortPixel or Imagify to optimize images, you’ll need to take additional steps to make sure the accessible PDFs you upload to your WordPress site stay accessible.

For people using other WordPress image optimization plugins, you’ll want to contact them directly to ask how to exclude your accessible PDFs from compression.

Have you discovered your accessible PDF files were stripped of tags? What steps did you take to resolve the issue?

Photo of author

About the Author

Deborah Edwards-Oñoro enjoys birding, gardening, taking photos, reading, and watching tennis. She's retired from a 25+ year career in web design, usability, and accessibility.