Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Disable PDF Thumbnail Previews in WordPress

Recently, one of our readers asked us how to disable PDF thumbnail previews in WordPress. Introduced in WordPress 4.7, this feature creates thumbnail images for all PDF files that you upload. In this article, we will show you how to easily disable PDF thumbnail previews in WordPress.

Disable PDF thumbnail previews in WordPress

Why Disable PDF Thumbnail Previews in WordPress?

WordPress 4.7 started generating thumbnail previews of PDF files uploaded from WordPress media uploader.

PDF thumbnail preview in WordPress 4.7

This is a very useful feature for most WordPress sites.

However, some site owners may already be using PDF plugins that handle thumbnail previews and the overall display of the PDF downloads on their website.

If the new feature is conflicting with their existing PDF uploads, then they may want to disable PDF thumbnail previews in WordPress.

Having said that, let’s take a look at how to easily disable PDF thumbnail previews in WordPress 4.7 and later versions.

Disable PDF Thumbnail Previews in WordPress

This tutorial requires you to add a simple code snippet on your WordPress site. If you haven’t done this before, then you may want to see our guide on pasting code snippets from web into WordPress.

You will need to add this code to your theme’s functions.php file or a site-specific plugin.

function wpb_disable_pdf_previews() { 
$fallbacksizes = array(); 
return $fallbacksizes; 
} 
add_filter('fallback_intermediate_image_sizes', 'wpb_disable_pdf_previews');

Don’t forget to save your changes.

This code simply gives WordPress an empty array for PDF thumbnail sizes and stops WordPress from generating thumbnail previews.

You can now try uploading a PDF file to your WordPress site using the media uploader. You will notice that WordPress will not generate any thumbnail previews for your PDF file.

No thumbnail preview

We hope this tutorial helped you learn how to disable PDF thumbnail previews in WordPress. You may also want to see our list of 24 must have WordPress plugins for business websites.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

1 CommentLeave a Reply

  1. Works! Thanks for posting this. This will save storage on my server. I’ve been asking myself why wordpress is generating images from my pdf files. I use woocommerce and couldn’t figure this out until your post. I tried to disable a few plugins before I began to suspect that this was a wordpress update. The PDF preview images don’t work on woocommerce anyhow since the images are placed in a protected directory. Thanks.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.