I run a multi-author website and many of my users are forgetting to set a featured image for their post. This is a big problem as my theme depends highly on featured images to keep a consistent feel throughout the site.

I've found a plugin that allows for a default featured image to be set if the user doesn't set one but this is far from perfect.

Is there anyway to have an error message pop-up when the featured image is not set and the user tries to publish, or potentially disabling the ability to publish a new post until a featured image is assigned?

Ideally I'd like to find a solution that pops up before the page is reloaded, to limit the frustration of the user/avoid unnecessary steps and time wasted reloading the page.

Thanks, Paul

1 Answer 1


you can hook yourself into save_post and check there if the image is present. if it is not there fire an admin_notice.

more here https://wordpress.stackexchange.com/a/15355/32776


Edit: I dont have the time to provide working code but here is a copy paste from the links above. i think that you have to figure what the field name is. maybe "thums" works.

as a start go to your functions.php

add_action( 'save_post', 'check_if_image_set' );

function check_if_image_set( $post_id ) {

    //verify post is not a revision
    if ( !wp_is_post_revision( $post_id ) ) {

        if ( get_post_meta($post_id, 'thumb', true) )

           add_action('admin_notices', 'my_admin_notice');


function my_admin_notice(){
    //print the message
    echo '<div id="message">
       <p>No Picture Set!!!</p>
    //make sure to remove notice after its displayed so its only displayed when needed.
    remove_action('admin_notices', 'my_admin_notice');

Best Regards, Simon

  • Thanks for the reply Simon, are you able to provide a little more clarification as to exactly how I'm able to do this? May 13, 2013 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.