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 you upload. In this article, we will show you how to easily disable PDF thumbnail previews in WordPress.
WordPress 4.7 started generating thumbnail previews of PDF files uploaded from the WordPress media uploader.
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 general display of PDF downloads on their website.
If the new feature conflicts with your existing PDF uploads, you may want to disable PDF thumbnail previews in WordPress.
With that said, let's see how to easily disable PDF thumbnail previews in WordPress 4.7 and later.
This tutorial requires you to add a simple code snippet to your WordPress site. If you haven't done this before, you can check out our guide on how to paste web code snippets into WordPress.
You'll need to add this code to your theme's functions.php file or a site-specific plugin.
función wpb_disable_pdf_previews () $ fallbacksizes = array (); devuelve $ 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 prevents WordPress from generating thumbnail previews.
You can now try to upload a PDF file to your WordPress site using the media uploader. You will notice that WordPress will not generate thumbnail previews for your PDF file.
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 enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Facebook.