Disable thumbnail preview of PDF in WordPress Content Management System400

Author: InfoBeep - August 1, 2017 | subject to copyright

WordPress introduced thumbnail images feature in WordPress 4.7 version. In this article, we will guide you how you can disable PDF thumbnail previews in WordPress.

Why Disable PDF thumbnail previews in WordPress?

There is a plugin called PDF plugins which handle thumbnail previews as well as the overall display of PDF downloads on their website. Since, the WordPress default thumbnail preview and plugin preview may create issues, WordPress site owners may want to disable this feature.

Disable PDF thumbnail previews in WordPress

To, disable thumbnail previews in your site, paste the code in functions.php file or site-specific plugin and save it.


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

add_filter('fallback_intermediate_image_sizes', 'my_disable_pdf_previews');

(Note: This code gives WordPress an empty array for PDF thumbnail as a result WordPress would stop showing thumbnail preview itself.)