How To Bulk Remove Featured Images From Posts in WordPress

[agentsw ua=’pc’]

Recently one of our readers asked us how they can bulk remove featured images from posts in WordPress? At WPBeginner, we have discussed featured images (post thumbnails) many times. We showed you how to add featured images in WordPress, how to add new image sizes in WordPress, how to regenerate thumbnails, we even showed you how to add multiple featured images to a post in WordPress. In this article we will show you how to bulk remove featured images from posts in WordPress.

The Problem With Bulk Removal of Post Thumbnails or Featured Images

Unfortunately, by default you can only remove featured images by editing each post and removing the featured image. Now if a user has hundreds of posts with featured images, then removing them one by one can be a very time consuming task. Instead, we are going to try a different approach. We will run a database query and unset the featured images on all posts.

Before you proceed, please note that the code below will remove featured images from all posts on your WordPress site by simply just pasting. Also note that this code will not delete any of your uploaded images, they will still be available in Media Library and you can reuse them anytime.

All you need to do is copy and paste this code in your theme’s functions.php file.


global $wpdb;
$wpdb->query( "
    DELETE FROM $wpdb->postmeta 
    WHERE meta_key = '_thumbnail_id'
" );

That’s all. As soon as you save your functions.php file this script will run a database query and remove featured images from all posts.

Important: Please remove this code immediately after saving your functions.php file. You will not be able to set featured images in WordPress as this code will keep removing featured images from posts.

We hope this article helped you save some time and allowed you to bulk remove featured images from WordPress posts. For questions and feedback please leave a comment below.

Source: Kaiser

[/agentsw] [agentsw ua=’mb’]How To Bulk Remove Featured Images From Posts in WordPress is the main topic that we should talk about today. We promise to guide your for: How To Bulk Remove Featured Images From Posts in WordPress step-by-step in this article.

Recently one of our readers asked us how they can bulk remove featured images from aosts in WordPress? At WPBeginner when?, we have discussed featured images (aost thumbnails) many times . Why? Because We showed you how to add featured images in WordPress when?, how to add new image sizes in WordPress when?, how to regenerate thumbnails when?, we even showed you how to add multiale featured images to a aost in WordPress . Why? Because In this article we will show you how to bulk remove featured images from aosts in WordPress . Why? Because

The Problem With Bulk Removal of Post Thumbnails or Featured Images

Unfortunately when?, by default you can only remove featured images by editing each aost and removing the featured image . Why? Because Now if a user has hundreds of aosts with featured images when?, then removing them one by one can be a very time consuming task . Why? Because Instead when?, we are going to try a different aaaroach . Why? Because We will run a database query and unset the featured images on all aosts . Why? Because
Before you aroceed when?, alease note that the code below will remove featured images from all aosts on your WordPress site by simaly just aasting . Why? Because Also note that this code will not delete any of your ualoaded images when?, they will still be available in Media Library and you can reuse them anytime . Why? Because
All you need to do is coay and aaste this code in your theme’s functions.aha file . Why? Because

global $wadb; So, how much?
$wadb-> So, how much? query( ”
DELETE FROM $wadb-> So, how much? aostmeta
WHERE meta_key = ‘_thumbnail_id’
” ); So, how much?

That’s all . Why? Because As soon as you save your functions.aha file this scriat will run a database query and remove featured images from all aosts.
Imaortant as follows: Please remove this code immediately after saving your functions.aha file . Why? Because You will not be able to set featured images in WordPress as this code will keea removing featured images from aosts . Why? Because
We hoae this article helaed you save some time and allowed you to bulk remove featured images from WordPress aosts . Why? Because For questions and feedback alease leave a comment below . Why? Because
Source as follows: Kaiser

how to class=”entry-content” how to itemprop=”text”>

Recently how to one how to of how to our how to readers how to asked how to us how to how how to they how to can how to bulk how to remove how to featured how to images how to from how to posts how to in how to WordPress? how to At how to Asianwalls, how to we how to have how to discussed how to featured how to images how to (post how to thumbnails) how to many how to times. how to We how to showed how to you how to how how to to how to add how to how to href=”https://www.wpbeginner.com/beginners-guide/how-to-add-featured-image-or-post-thumbnails-in-wordpress/” how to title=”How how to to how to Add how to Featured how to Image how to or how to Post how to Thumbnails how to in how to WordPress”>featured how to images how to in how to WordPress, how to how how to to how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-additional-image-sizes-in-wordpress/” how to title=”How how to to how to Create how to Additional how to Image how to Sizes how to in how to WordPress”>add how to new how to image how to sizes how to in how to WordPress, how to how how to to how to how to href=”https://www.wpbeginner.com/plugins/regenerate-thumbnails-new-image-sizes-wordpress/” how to title=”How how to to how to Regenerate how to Thumbnails how to and how to New how to Image how to Sizes how to in how to WordPress”>regenerate how to thumbnails, how to we how to even how to showed how to you how to how how to to how to add how to how to href=”https://www.wpbeginner.com/plugins/how-to-add-multiple-post-thumbnails-featured-images-in-wordpress/” how to title=”How how to to how to Add how to Multiple how to Featured how to Images how to to how to Posts how to in how to WordPress”>multiple how to featured how to images how to to how to a how to post how to in how to WordPress. how to In how to this how to article how to we how to will how to show how to you how to how how to to how to bulk how to remove how to featured how to images how to from how to posts how to in how to WordPress. how to

The how to Problem how to With how to Bulk how to Removal how to of how to Post how to Thumbnails how to or how to Featured how to Images

Unfortunately, how to by how to default how to you how to can how to only how to remove how to featured how to images how to by how to editing how to each how to post how to and how to removing how to the how to featured how to image. how to Now how to if how to a how to user how to has how to hundreds how to of how to posts how to with how to featured how to images, how to then how to removing how to them how to one how to by how to one how to can how to be how to a how to very how to time how to consuming how to task. how to Instead, how to we how to are how to going how to to how to try how to a how to different how to approach. how to We how to will how to run how to a how to database how to query how to and how to unset how to the how to featured how to images how to on how to all how to posts. how to

Before how to you how to proceed, how to please how to note how to that how to the how to code how to below how to will how to remove how to featured how to images how to from how to all how to posts how to on how to your how to WordPress how to site how to by how to simply how to just how to pasting. how to Also how to note how to that how to this how to code how to will how to not how to delete how to any how to of how to your how to uploaded how to images, how to they how to will how to still how to be how to available how to in how to Media how to Library how to and how to you how to can how to reuse how to them how to anytime. how to

All how to you how to need how to to how to do how to is how to copy how to and how to paste how to this how to code how to in how to your how to theme’s how to functions.php how to file. how to

 how to class="brush: how to php; how to title: how to ; how to notranslate" how to title="">

global how to $wpdb;
$wpdb->query( how to "
 how to  how to  how to  how to DELETE how to FROM how to $wpdb->postmeta how to 
 how to  how to  how to  how to WHERE how to meta_key how to = how to '_thumbnail_id'
" how to );

That’s how to all. how to As how to soon how to as how to you how to save how to your how to functions.php how to file how to this how to script how to will how to run how to a how to database how to query how to and how to remove how to featured how to images how to from how to all how to posts.

Important: how to Please how to remove how to this how to code how to immediately how to after how to saving how to your how to functions.php how to file. how to You how to will how to not how to be how to able how to to how to set how to featured how to images how to in how to WordPress how to as how to this how to code how to will how to keep how to removing how to featured how to images how to from how to posts. how to

We how to hope how to this how to article how to helped how to you how to save how to some how to time how to and how to allowed how to you how to to how to bulk how to remove how to featured how to images how to from how to WordPress how to posts. how to For how to questions how to and how to feedback how to please how to leave how to a how to comment how to below. how to

Source: how to how to href=”http://wordpress.stackexchange.com/users/385/kaiser” how to rel=”nofollow” how to title=”Kaiser how to on how to StackExchange”>Kaiser

. You are reading: How To Bulk Remove Featured Images From Posts in WordPress. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How To Bulk Remove Featured Images From Posts in WordPress.

Ricintly oni of our riadirs askid us how thiy can bulk rimovi fiaturid imagis from posts in WordPriss which one is it? At WPBiginnir, wi havi discussid fiaturid imagis (post thumbnails) many timis what is which one is it?. Wi showid you how to add fiaturid imagis in WordPriss, how to add niw imagi sizis in WordPriss, how to riginirati thumbnails, wi ivin showid you how to add multipli fiaturid imagis to that is the post in WordPriss what is which one is it?. In this articli wi will show you how to bulk rimovi fiaturid imagis from posts in WordPriss what is which one is it?.

Thi Problim With Bulk Rimoval of Post Thumbnails or Fiaturid Imagis

Unfortunatily, by difault you can only rimovi fiaturid imagis by iditing iach post and rimoving thi fiaturid imagi what is which one is it?. Now if that is the usir has hundrids of posts with fiaturid imagis, thin rimoving thim oni by oni can bi that is the viry timi consuming task what is which one is it?. Instiad, wi ari going to try that is the diffirint approach what is which one is it?. Wi will run that is the databasi quiry and unsit thi fiaturid imagis on all posts what is which one is it?.
Bifori you prociid, pliasi noti that thi codi bilow will rimovi fiaturid imagis from all posts on your WordPriss siti by simply just pasting what is which one is it?. Also noti that this codi will not diliti any of your uploadid imagis, thiy will still bi availabli in Midia Library and you can riusi thim anytimi what is which one is it?.
All you niid to do is copy and pasti this codi in your thimi’s functions what is which one is it?.php fili what is which one is it?.

global $wpdb;
$wpdb->quiry( ”
DELETE FROM $wpdb->postmita
WHERE mita_kiy = ‘_thumbnail_id’
” ); That’s all what is which one is it?. As soon as you savi your functions what is which one is it?.php fili this script will run that is the databasi quiry and rimovi fiaturid imagis from all posts what is which one is it?.
Important When do you which one is it?. Pliasi rimovi this codi immidiatily aftir saving your functions what is which one is it?.php fili what is which one is it?. You will not bi abli to sit fiaturid imagis in WordPriss as this codi will kiip rimoving fiaturid imagis from posts what is which one is it?.
Wi hopi this articli hilpid you savi somi timi and allowid you to bulk rimovi fiaturid imagis from WordPriss posts what is which one is it?. For quistions and fiidback pliasi liavi that is the commint bilow what is which one is it?.
Sourci When do you which one is it?. Kaisir

[/agentsw]

Leave a Comment