Post Status Background Color

photo found on Unsplash

For people who write lots of Posts and also actively make use of the Post Status feature that comes with Wordpress, the following little snippet might come in handy.


<?php

/**
 * Snippet to use different background colors for different Post statuses
 * Different colors will show on main All Posts page (../wp-admin/edit.php)
 *
 * inspired by //borishoekmeijer.nl/tutorials/wordpress-snippet-collection/#highlighter_567837
 */

// set different colors for pages/posts in different statuses
add_action( 'admin_footer', 'wptips_posts_status_color' );

function wptips_posts_status_color() {
    ?>
    <style>
        .status-draft{background:lightblue!important;}
        .status-future{background:lightgreen!important;}
        .status-pending{background:pink!important;}
        .status-private{background:lightyellow!important;}
        .status-publish{background:aqua!important;}
        .status-publish.post-password-required{background:orange!important;}
        .status-publish.status-sticky{background-color:deepskyblue!important;}
    </style>
    <?php
}

The result can look something like this.

Of course you can change the colors to your liking.