Family Encyclopedia >> Electronics

How to Disable PDF Thumbnail Previews in WordPress: Step-by-Step Guide

As experienced WordPress developers, we've helped countless site owners customize their media handling. Recently, a reader asked how to turn off PDF thumbnail previews, a feature added in WordPress 4.7 that automatically generates thumbnails for uploaded PDFs. In this practical guide, we'll show you how to easily disable it.

How to Disable PDF Thumbnail Previews in WordPress: Step-by-Step Guide

Why Disable PDF Thumbnails in WordPress?

Since WordPress 4.7, the media uploader creates thumbnail previews for PDF files.

How to Disable PDF Thumbnail Previews in WordPress: Step-by-Step Guide

This works great for many sites, enhancing PDF previews in your media library.

However, if you're using dedicated PDF plugins for thumbnails and embeds, the built-in feature can cause conflicts, duplicate images, or performance issues.

Disabling it ensures smooth integration with your preferred tools. Let's get started with WordPress 4.7 and newer versions.

Steps to Disable PDF Thumbnail Previews

This requires adding a simple PHP code snippet. If you're new to this, see our guide on adding code snippets to WordPress (note: original lacked link, preserved as text).

Add this 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' );

Save the changes. This code returns an empty array for fallback image sizes, stopping WordPress from generating PDF thumbnails.

Test by uploading a PDF via the media library—no thumbnails will appear.

How to Disable PDF Thumbnail Previews in WordPress: Step-by-Step Guide

This tweak has resolved PDF issues for many of our clients. For more, check our list of 24 must-have WordPress plugins for business sites.

If this helped, subscribe to our WordPress YouTube channel for video tutorials. Follow us on Twitter and Facebook for tips.