Facebook-f X-twitter
EncodeByte
Need Help!
  • How-To
    How-ToShow More
    How To Redirect Old Website To New Domain Without Losing SEO | 301 Domain Redirect
    By
    Franchbabu
    How to Fix the “Windows Cannot Be Installed to This Disk” Error
    By
    EncodeMore
    How to Check Your Laptop’s Battery Health: A Step-by-Step Guide
    By
    EncodeMore
    How to Become a Freelancer in 2025: A Comprehensive Guide.
    By
    EncodeMore
    How to Activate Windows Legally and For Free (100% Working)
    By
    EncodeMore
  • Web Development & Coding
    Web Development & CodingShow More
    How to Become a Freelancer in 2025: A Comprehensive Guide.
    By
    EncodeMore
    Top In-Demand Freelancer Niches for 2025 – Fast Growth Ahead!
    By
    EncodeMore
    🚀 10 Reasons Why Hostinger Is the Best Web Hosting Platform for Speed, Security & Affordability
    By
    Franchbabu
    How to Add “Made with ❤️” to Your WordPress Footer (No Plugin Needed)
    By
    EncodeMore
    WordPress Redirect After Login: How to Set It Up
    By
    EncodeMore
  • Code Snippets & Scripts
    Code Snippets & ScriptsShow More
    How to Hide a Class in WordPress (Easy CSS & Admin Tips)
    By
    EncodeMore
  • Website Design & UX
    Website Design & UXShow More
    10 Web Design Mistakes That Are Killing Your User Experience (and How to Fix Them)
    By
    Franchbabu
  • Make Money Online
    Make Money OnlineShow More
    How to Become a Freelancer in 2025: A Comprehensive Guide.
    By
    EncodeMore
    Top In-Demand Freelancer Niches for 2025 – Fast Growth Ahead!
    By
    EncodeMore
    Website related skillsets that you shoud have
    By
    EncodeMore
    Top Sites Like Fiverr: The Best Fiverr Alternatives for Freelancers
    By
    Franchbabu
    Best Telegram Channels For Free Paid Courses
    By
    Franchbabu
  • 🤩 Trending:
  • How-To Guides
  • WordPress & Website Development
  • Web Development & Coding
  • Windows & Software Fixes
  • Tech Tips, Tools & Tutorials
  • Computer Tips & Tricks
Font ResizerAa
EncodeByteEncodeByte
Search
  • How-To
  • Web Development & Coding
  • Code Snippets & Scripts
  • Website Design & UX
  • Make Money Online
Follow US
Made by ThemeRuby using the Foxiz theme. Powered by WordPress
How-To GuidesWordPress & Website Development

How to Upload WEBP images in WordPress (Without Any Plugins)

Last updated: June 23, 2021 3:47 am
By
Franchbabu
Share

To Upload WEBP images in WordPress,

WebP is a new image format that can help your WordPress website run faster by making image files smaller and faster to load.
We all know that quicker websites are better for SEO and user experience and that they help us keep visitors and search engines happy.

Contents
To Upload WEBP images in WordPress,Easy Steps To Upload Webp images in WordPress without pluginAdd this below-given code to your theme functions (functions.php)Add the below-given code to your theme functions (functions.php) to preview webp images on your media library

This article will teach you all you need to know about WebP and how to utilize it effectively on your WordPress site.

Easy Steps To Upload Webp images in WordPress without plugin

By default WordPress does not allow you to upload webp image files, if you want to upload webp image files to WordPress then follow these 6 easy steps below to upload webp images to WordPress.

  • Log in to your WordPress admin area
  • Appearance
  • Theme Editor

Open ” Theme Editor” In Appearance

  • Theme Functions [ functions.php]

Select the ” Theme Function (functions.php) ”

Upload WEBP images in WordPress
  • Copy and Paste this below-given Code and click on update file

You are done, now you will be able to Upload WEBP images in WordPress

Add this below-given code to your theme functions (functions.php)

function webp_upload_mimes( $existing_mimes ) {
    // add webp to the list of mime types
    $existing_mimes['webp'] = 'image/webp';
 
    // return the array back to the function with our added mime type
    return $existing_mimes;
}
add_filter( 'mime_types', 'webp_upload_mimes' );


After adding this code you will be upload WebP images in your WordPress but you can’t preview these images on your media library. If you want to see an image preview of these files on your media library you have to add some extra code to your Theme Functions (functions.php) of your WordPress Theme, The code is given below.

Add the below-given code to your theme functions (functions.php) to preview webp images on your media library

//** * Enable preview / thumbnail for webp image files.*/
function webp_is_displayable($result, $path) {
if ($result === false) {
$displayable_image_types = array( IMAGETYPE_WEBP );
$info = @getimagesize( $path );
 
if (empty($info)) {
$result = false;
} elseif (!in_array($info[2], $displayable_image_types)) {
$result = false;
} else {
$result = true;
}
}
 
return $result;
}
add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);

Share This Article
Facebook Whatsapp Whatsapp LinkedIn
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular Categories

Themes & Customization

1 Article

Troubleshooting & Fixes

1 Article

WordPress Tips & Tricks

6 Articles

WordPress Tutorials

5 Articles

Must Read

WordPress & Website DevelopmentHow-To Guides

How to Create a Private/Password Protected Post or Page in WordPress

How-To GuidesSEO Tips & StrategiesWordPress Tutorials

How To Redirect Old Website To New Domain Without Losing SEO | 301 Domain Redirect

Computer Tips & TricksHow-To Guides

How to Repair a Bad Hard Disk (Hard Disk Low Level Format)

How-To GuidesTech Tips, Tools & Tutorials

How to Remove URLs From Google Search

  • I need help with …

Starting a Blog

WordPress SEO

WordPress Performance

WordPress Errors

WordPress Security

Got A Question?

Need Expert Help?
Let CodeXcool power up your website with
custom WordPress design, speed optimization, and SEO!
🚀 Get Started

You Might also Like

Web Development & CodingWordPress & Website Development

The Ultimate WordPress Security Guide – Step by Step (2024)

Plugins & ToolsPerformance Optimization

Top 15 Most Popular & Best WordPress Themes in 2025 (Expert Picks)

How-To GuidesWordPress & Website Development

How to Backup your WordPress site to Google drive via WP Plugin?

Beginner ProjectsSEO Tips & Strategies

A Guide to Effective SEO Tactics to Improve Ranking

EncodeByte

© 2025 EncodeByte – Discover expert tech tutorials, coding guides, troubleshooting solutions, and free tools. Simplify technology, build smarter, and learn faster with us.

About Us / Privacy Policy / Contact Us

Latest News

  • Coming Soon
  • Coming Soon
  • Coming Soon
  • Coming Soon

Services

  • Coming Soon
  • Coming Soon
  • Coming Soon
  • Coming Soon

Looking for custom web development or maintenance?

Check out our parent team at [CodeXcool.com] 🚀
— Let's build together!
Request a Quote
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?