Require a featured image to publish post

I have a multi author WordPress blog.
I'd like to allow publishing of a post only when a featured image is set.

How can that be done?

Solutions

You can do something like this with the hook pre_post_update :

function wpse_108013_mandatory_featured_image() {
 if(!has_post_thumbnail()) { // here you check if there's a featured image
      wp_die( 'Featured image must always be set !' ); // there is no featured image
 } 
}
add_action( 'pre_post_update', 'wpse_108013_mandatory_featured_image' );

Similar questions

Change publish date from meta date when publish post
When the post is publish, I want the publish date as the same as the date in the meta data, imic_sermon_date. Here's my code. The problem is that it get stuck when publishing a post. Can someone help me with this? Thanks.
Getting the Featured image URL and inserting it as Custom Field on Post update / publish
I've tried a number of solutions posted here regarding converting custom fields to featured images - of course in reverse; but non seem to work for me. What I'm trying to do is grab the Featured Image URL once the image is uploaded and set as a featured image; then automatically set the full size image URL as a custom field. This needs to work on b...
Wordpress - Publish post with featured image at same time via PHP
I am publishing to Wordpress via PHP, as follows. Problem: When creating the Post, there is a Plugin (SNAP autoposter) that will automatically publish it on Facebook. But, as obvious, it does not wait until the featured image is attached. Question: How should I proceed to publish the post with an already assigned attachment? Thanks a lot for your h...
I want to fetch latest 3 post from wordpress with title,description ,featured image, date of publish using mysql query or using xmlrpc api
I want to display it to jsf site. Currently I am using xmlrpc with jwordpress. I have also access to wordpress db.
Why does Wordpress featured image not save when I publish my post?
I inherited this website from another developer. We recently updated the Advanced Custom Fields PRO plugin to fix a different issue and it was working fine. I got a call this morning that the featured image appears when being added to the post, but when they publish it the featured image disappears. I've checked to make sure that featured images ar...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy .