Color Code your WordPress Posts by Post Status in Admin

You can color code your posts by their post status

This little snippet (courtesy of WordPress Code Snippets) allows you to color code the posts in your admin area, so that you can identify posts by their post status.

For example, in the snippet I have provided below, I have colored drafts in yellow, scheduled posts in green, private posts in red, posts that are pending review in blue and left all published posts as standard, with the alternating row colors.

This is useful for people who like to plan out their posts, because you can readily see how many posts are scheduled and ready, how many drafts you’ve got waiting to be finished, and if you’re an editor of a multi-contributor blog, you can see if you have any posts that need to be reviewed.

To enable this, copy the snippet below and paste it in your functions.php file (public_html/wp-content/themes/activetheme/functions.php). Obviously, if you want to customise it, you can change the colors using any CSS color declaration you choose.

22 thoughts on “Color Code your WordPress Posts by Post Status in Admin”

  1. kevin Chard says:

    Thanks for posting my snippet glad you like it.

    1. My pleasure. I read your site regularly and you’ve got a load of good stuff on there. Keep up the good work!

      1. kevin Chard says:

        Hey thanks glad to hear it.

  2. Himanshu says:

    this cool. wordpress should have made this by default. thanks for sharing

    1. I personally find it useful, but I think WordPress needs to be careful about features that they incorporate into the core system, as these features need to be for the benefit of most users – I’m not sure that most users would benefit from it, but I could be wrong…

  3. BadCat says:

    Seems like adding this to functions.php disables the “Screen Options” (upper right) in the Posts page under WP 3.2.1

    1. Is that your experience? There’s no reason why it should. i just checked my installation (I am using this function), but the Screen Options drop-down is still there on the Posts page…

    2. kevin Chard says:

      This should not cause a problem, however I did notice a mistake in the snippet it is missing the last tag within the function. I’m not sure this would cause the screen options problem but it could cause an issue.

      1. BadCat says:

        I’ve added the closing tag and it works fine now. Thanks!

      2. Right you are Kevin. Didn’t affect me any, but it’s obviously good practice to close the tag. I’ve updated the tutorial now. Thanks for your eagle eye ;)

  4. marvic says:

    These is one great idea Dave. Having it Color coded, make it look organize and easy to search . I should try these thing’s, and see what will it looks like.

    1. Thanks Marvic. I hope you find it useful on your own sites

  5. Emma says:

    Indeed color coding can do wonders, it gets our out attention and encourages us to be more organized. Thanks, Dave!

    1. Yes, I’m quite organised, so it suits me well, but I can imagine there are a good number of people for whom this will be useless!

      Thanks for your comment

  6. Renji says:

    There’s an extension called UI Labs that applies neat color-coding to post statuses, but since this doesn’t involve installing any plugins am going to use it. Thanks!

    1. Oh really? I hadn’t heard of that. Seems like a bit of overkill to do that in a plugin when the function is so simple. Thanks for your comment.

  7. Sabs says:

    Very cool – I’m planning to start writing a couple posts at a time and this will help me keep organized for scheduled posts.

    1. Glad to hear it. I’m definitely of the opinion that planning out your posts does wonders for your blog. Good luck!

  8. Mark says:

    At the moment I’m keeping track of my posts with a spreadsheet. Using this snippet looks like a better approach, and hopefully it will simplify things. I’m going to give it a go. Thanks.

    1. Yeah, keeping track of it in a spreadsheet seems like a lot of extra work. I prefer to have everything in one place myself. Good luck!

  9. sanjay says:

    David, thanks for sharing this! Need to know everything about WordPress, your site is full of wp info.

    1. You’re quite welcome Sanjay. I hope to keep providing you with useful information

Leave a Reply