CALL (239) 961-8285
ENDURTECH
  • Web Services
    • Web Design
      • Design and Development
      • Web Consulting and Tutoring
      • Hosting and Maintenance
      • Project Portfolio
    • Media
      • Photo and Audio, Video Editing
      • Social Media Management
      • All Web Related Services
    • Marketing
      • Digital Marketing and Branding
      • Search Engine Optimization
    • Client Portal
      • Remote Web Support
      • Web Services Payment
      • Scheduled Payments
  • Tech Support
    • Services
      • Computer Support and Repair
      • Data Backup and Recovery
      • Computer Security, Virus Removal
      • Computer Networking Support
      • Computer Consulting & Tutoring
      • All Technology Related Services
    • Blockchain
      • Blockchain Technology
      • Cryptocurrency Articles
    • Client Portal
      • Remote PC Support
      • Remote Monitoring & Management
      • Tech Services Payment
  • Articles
  • About
  • Talk to Me
  • Menu Menu

Disable PDF Preview in WordPress Media Gallery

Accessibility, PHP, Plugins, Snippet, Themes, Web Site Support, WordPress

If you’ve ever uploaded a PDF to your WordPress site and noticed that WordPress automatically generates a preview image, you’re not alone. Since WordPress 4.7, this feature has been enabled by default.

While it’s helpful for some, others may find it unnecessary or even problematic—especially if you’re managing a large media library or want to conserve server resources.

In this post, we’ll walk you through why you might want to disable PDF previews and how to disable the previews safely and effectively.

 

Why Disable PDF Previews?

Here are a few reasons you might want to turn off this feature:

  • Performance: Generating preview images can slow down uploads, especially for large PDFs.
  • Storage: Each preview image takes up additional space on your server.
  • Aesthetics: You may prefer a cleaner Media Library without auto-generated thumbnails.
  • Control: You might want to use your own custom icons or thumbnails instead.

Disabling PDF previews in WordPress is a simple tweak that can streamline your media management and improve performance. Whether you’re a developer or a casual site owner, taking control of how your media behaves is always a win.

 

How WordPress Generates PDF Previews

WordPress uses the Imagick PHP extension to create a JPEG preview of the first page of your PDF. This image is then treated like any other media attachment and appears in your Media Library.

How to Disable PDF Previews

There are two main ways to disable this feature: via a plugin or by adding custom code to your theme.

Option 1: Add a Code Snippet to Your Theme

You can disable PDF previews by adding the following code to your theme’s functions.php file or a custom plugin:

add_filter( ‘fallback_intermediate_image_sizes’, ‘disable_pdf_previews’ );
function disable_pdf_previews( $fallbacksizes ) { return []; } 

This filter tells WordPress not to generate any fallback image sizes for PDFs, effectively disabling the preview.

Important: Always back up your site before editing theme files, and consider using a child theme to avoid losing changes during updates.

Option 2: Use an Existing WordPress Plugin

If you’re not comfortable editing code, you can use a plugin like Code Snippets to safely add the code above without touching your theme files.

  1. Install and activate the Code Snippets plugin.
  2. Go to Snippets > Add New.
  3. Paste the code snippet above.
  4. Save and activate the snippet.

 

Verifying It Works

After applying the change:

  1. Upload a new PDF via Media > Add New.
  2. Check the Media Library—there should be no preview image generated.
  3. Only the original PDF file should appear.

 

Optional: Clean Up Existing PDF Previews

Disabling previews won’t remove existing ones. To clean up old preview images:

  • Use a plugin like Media Cleaner or WP-Optimize to remove unused media files.
  • Manually delete preview images via FTP or your hosting file manager (look for files with the same name as your PDF but with .jpg extensions).

 

Conclusion

I welcome your thoughts, questions or suggestions on my article on how to disable PDF previews within the Media Gallery on WordPress.

You may support my work by sending me a tip using your Brave browser or by sending me a one time donation using your credit card.

Let me know if you found any errors within my article or if I may further assist you by answering any additional questions you may have.

 

June 13, 2025
Share this entry
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://endurtech.com/wp-content/uploads/2018/04/wordpress-content-management-system.jpg 512 512 Manny https://endurtech.com/wp-content/uploads/2018/04/endurtech-logo.png Manny2025-06-13 16:06:592025-11-12 20:37:17Disable PDF Preview in WordPress Media Gallery
Search Search

CONNECT WITH US

This field is for validation purposes and should be left unchanged.
Engagement*

Want to say, "thanks"?
Leave me a review on Facebook and/or Google.

You can send me a tip using your Brave browser. Get Brave!

Only used to send you a receipt.
Include a Message
Popular
  • Windows Logo
    Second Monitor on Windows 10 Resets After SleepJuly 2, 2020 - 6:30 am
  • Windows Logo
    How to Disable the F1 Help Key in Windows 10April 15, 2021 - 2:40 pm
  • Cortana Logo
    How to Disable Microsoft’s CortanaApril 6, 2021 - 9:00 am
  • Firefox Logo
    How to Remove All Passwords from Lockwise in FirefoxMarch 26, 2020 - 11:00 am
Recent
  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar Err...July 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

STAY IN TOUCH

ENDURTECH Web Design Company Naples, Florida

Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Learn More & Connect

Search Search
ENDURTECH Logo
Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Latest Articles

  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar ErrorJuly 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

Recent Projects

  • Jewelry Website Gems of Note
    Gems of NoteNovember 15, 2019 - 10:16 pm
  • Gift Store Facebook Business Page Cover Video
    Gift Store Facebook Business Page Cover VideoApril 13, 2019 - 3:58 pm
  • Toledo Yoga BrandBot Footer Integration
    Toledo YogaApril 9, 2019 - 7:26 am
  • Lawyer Association Website with Member Portal
    National Employment Lawyers Association, Florida ChapterFebruary 26, 2019 - 8:00 am

Business Details

Mondays - Fridays
9:00 am - 5:00 pm
Eastern Standard Time
After hours by appointment

SUPPORT PHONE

(239) 961-8285

MAILING ADDRESS

59 Logan Ln.
Lynchburg, VA 24502

Copyright © 2026 ENDURTECH ® All Rights Reserved. Legal
Link to: Hide WordPress Admin Panel Help Tab Link to: Hide WordPress Admin Panel Help Tab Hide WordPress Admin Panel Help TabWordPress Content Management System Icon Link to: Manage Calendar Permissions in Exchange Online Link to: Manage Calendar Permissions in Exchange Online Windows LogoManage Calendar Permissions in Exchange Online
Scroll to top Scroll to top Scroll to top