Efficient Guide to Disabling PDF Thumbnail Previews in WordPress

Date:

Share post:

Are you encountering conflicts with WordPress PDF plugins because of the thumbnail previews feature? In this comprehensive guide, we will walk you through the process of disabling PDF thumbnail previews in WordPress to help you resolve any issues you may be facing.

Ever since WordPress 4.7 was released, thumbnail previews have been automatically generated for PDF files uploaded to your WordPress site. While this can be advantageous for most websites, it can lead to problems for those using PDF plugins that handle thumbnail previews. If you find yourself experiencing conflicts, follow the step-by-step instructions below to disable PDF thumbnail previews.

Using the WPCode Plugin

  1. Begin by installing and activating the WPCode plugin on your WordPress site.
  2. Once the plugin is activated, navigate to Code Snippets » + Add Snippet in your WordPress admin dashboard.
  3. Hover over ‘Add Your Custom Code (New Snippet)’ and click on ‘Use Snippet’.
  4. Give your code snippet a name in the provided field.
  5. Copy and paste the following code into the ‘Code Preview’ box:
/**
* Disable PDF thumbnail previews in WordPress
*/
function wpb_disable_pdf_thumbnails() {
  update_option( 'thumbnail_size_h', 0 );
  update_option( 'thumbnail_size_w', 0 );
}

add_action( 'init', 'wpb_disable_pdf_thumbnails' );
  1. From the ‘Code Type’ dropdown menu, select ‘PHP Snippet’.
  2. Toggle the switch at the top to make the snippet ‘Active’.
  3. Click on ‘Save Snippet’ to execute the code on your website.

By adding this code snippet, you are essentially instructing WordPress to set the PDF thumbnail sizes as empty, effectively preventing the generation of thumbnail previews for PDF files.

Verifying the Disabled Feature

To confirm that the PDF thumbnail previews are successfully disabled on your WordPress site, follow these simple steps:

  1. Access the WordPress media uploader.
  2. Upload a PDF file.
  3. Observe that WordPress no longer generates any thumbnail previews for your PDF files.

We believe that this tutorial has helped you resolve conflicts caused by PDF thumbnail previews in WordPress. For further enhancements to your WordPress site, take a look at our list of essential WordPress plugins for business websites. Additionally, if you are interested in incorporating custom code in WordPress, check out our comprehensive guide on how to easily add custom code.

If you found this article helpful, please consider subscribing to our YouTube Channel for more informative WordPress video tutorials. Stay connected with us on Twitter and Facebook as well.

Subscribe to our newsletter

Stay ahead of the game! Subscribe to our newsletter for exclusive tips and insights on Data Structures & Algorithms and interview preparation.

Leave a Reply

Related articles

10 Effective Growth Hacking Techniques to Boost Your Online Influence**

The Influence of Online Power: 10 Techniques for Boosting Growth In today's digital world, having a strong online presence...

Boost Your Productivity with Checklists: An Essential Tool for Every Blogger and Marketer

The Power of Using Checklists: Enhancing Your Efficiency as a Blogger or Marketer In the fast-paced world we live...

Convert Webpages to PDFs: A Simple Guide**

Finding an easy and reliable way to convert webpages to PDF files can be a daunting task. Many...

Mastering Freelance Success: Key Tips for Building a Thriving Career

Keys to Creating a Successful Freelance Business: Essential Strategies and Techniques Introduction: Flourishing in the Freelance Economy As the gig...