How to Disable PDF Thumbnail Previews in WordPress (Expert Tips)

Have you ever uploaded a PDF to your WordPress site only to find it has a duplicate thumbnail preview? You may be wondering how to disable those automatic PDF thumbnails.

As an experienced WordPress webmaster, I‘ve helped dozens of sites handle their PDFs properly. In this guide, I‘ll show you exactly how to disable PDF thumbnails when needed.

The Rise of PDFs in WordPress

Let‘s start with some context. PDF usage in WordPress has grown rapidly in recent years.

According to Hubspot, over 35% of WordPress sites now host PDF content. The format‘s flexibility and security make it perfect for reports, guides, and more.

With the introduction of built-in PDF thumbnail generation in WordPress 4.7, managing PDFs got a bit more complicated. Now conflicts can arise with other plugins.

But with a few tweaks, you can get your PDFs playing nicely in WordPress again.

Why You May Want to Disable PDF Thumbnails

The default WordPress PDF thumbnails can be useful for many sites. But others may benefit from disabling this new feature.

If you use a dedicated PDF plugin that handles thumbnails separately, you likely want to disable the default previews to avoid duplication.

Some examples of popular PDF plugins that conflict with built-in thumbnails:

  • PDF Embedder – provides rich PDF display options but handles thumbnails independently.

  • PDF Viewer – features a robust PDF viewer and image generation.

  • PDF & Print – optimizes PDF display and printing with its own thumbnail system.

Duplicated thumbnails from these plugins and the core WordPress previews can overload your media library and slow your site.

So if you already have a preferred PDF solution, let‘s look at turning off default thumbnail creation.

How to Disable PDF Thumbnails in WordPress

The easiest way to disable PDF thumbnails is by using a simple PHP code snippet. No need to edit your files directly.

Here are the steps I recommend to properly add the disabling code:

Step 1: Install the WPCode Snippet Plugin

Download and install the free WPCode plugin from the WordPress repository. This allows safely adding custom code snippets.

Once installed, activate the WPCode plugin from your plugins page.

Step 2: Create a New PHP Code Snippet

In your WordPress dashboard, navigate to WPCode > Add Snippet and select "PHP Snippet" as the code type.

Give your snippet a descriptive name like "Disable PDF Thumbnails".

Step 3: Paste in Disabling Code

Add this code to the snippet editor:

function wpb_disable_pdf_previews() {
  $fallbacksizes = array();
  return $fallbacksizes; 
}

add_filter(‘fallback_intermediate_image_sizes‘, ‘wpb_disable_pdf_previews‘);

This gives WordPress an empty array for PDF thumbnail sizes, preventing any thumbnails from being generated.

Step 4: Activate and Save Snippet

Make sure your new snippet is toggled "On" to activate it. Then click "Save Snippet".

The disabling code will now run across your WordPress site.

Step 5: Test It Out

Upload a new PDF through your media library. You should no longer see a thumbnail preview image generated for it.

If you still see thumbnails, double check that your snippet is active and contains the proper code.

And that‘s it! With those few quick steps, you‘ve successfully disabled PDF thumbnail generation in WordPress.

Re-Enabling PDF Thumbnails Later

If you want to re-enable default PDF thumbnails in the future, simply deactivate or delete the disabling snippet in WPCode.

This will restore the standard WordPress behavior of generating thumbnail previews for your PDF uploads.

Alternative Methods (Not Recommended)

Some tutorials suggest adding the disabling code directly to your theme‘s functions.php file.

I don‘t recommend this approach as it can cause issues or conflicts down the road. The WPCode method is much safer and reversible.

Comparing Top PDF Plugins for WordPress

If you‘re using PDFs extensively, you may want to consider a dedicated PDF plugin. Here‘s how the top options compare:

Plugin Thumbnail Handling Pros Cons
PDF Embedder Generates own thumbnails Lightweight, free Limited features
PDF Viewer Has robust thumbnail settings Viewer customization Paid premium version
PDF & Print Handles thumbnail generation Printing optimization Not actively maintained

As you can see, all these tools have their own thumbnail functionality that conflicts with the default WordPress PDF previews.

So if you‘re using one of them, disabling the core preview feature is advised.

Expert Tips for Avoiding PDF Conflicts

Beyond just disabling thumbnails, here are some other pro tips for seamless PDF integration:

  • When possible, upload PDFs directly through your PDF plugin rather than the native WordPress uploader. This avoids conflicts.

  • If your PDF thumbnails aren‘t sharp, try adjusting image scaling settings in your PDF plugin‘s configuration.

  • For performance, use image compression and only generate 2-3 thumbnail sizes to cover all screens.

  • Always test PDF display on mobile too and tweak settings until satisfied.

Hopefully these tips help you take full control of your PDFs in WordPress!

Summary

In this guide, we looked at how to easily disable PDF thumbnail previews in WordPress using a simple code snippet.

This prevents conflicts when using dedicated PDF plugins that handle thumbnails separately.

We also explored top PDF plugins, expert performance tips, and more to master your PDFs.

Let me know if you have any other questions! I‘m always happy to help fellow WordPress users with PDFs and other media needs.

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.