If you are a blogger using WordPress, then you must be aware of the post statuses. Adding a custom post status is one of the useful features that lets your WordPress posts be organized easily. Every post you intend to publish on your site involves several levels of the editing process. So it is must be organized to know what level of editing does each post need before it goes live. WordPress core has some basic post statuses available in it. Apart from that if needed you can also add your own custom post status for better management of the post. So let’s see how to create custom post status in WordPress.
Ways to Create Custom Post Status in WordPress
There are two possible ways to add custom post status in WordPress and they are
- Without Plugins
- With Plugins
How to Create Custom Post Type Manually (Without Plugins)
[1] From your WordPress dashboard, go to Appearance and click on Theme editor. [2] Choose functions.php under the Theme Files. [3] Add the following line of code in the function.php file.// Registering custom post status
function wpb_custom_post_status(){
register_post_status('rejected', array(
'label' => _x( 'Rejected', 'post' ),
'public' => false,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Rejected (%s)', 'Rejected (%s)' ),
) );
}
add_action( 'init', 'wpb_custom_post_status' );
// Using jQuery to add it to post status dropdown add_action('admin_footer-post.php', 'wpb_append_post_status_list'); function wpb_append_post_status_list(){ global $post; $complete = ''; $label = ''; if($post->post_type == 'post'){ if($post->post_status == 'rejected'){ $complete = ' selected="selected"'; $label = '<span id="post-status-display"> Rejected </span>''; } echo' <script> jQuery(document).ready(function($){ $("select#post_status").append("<option value=\"rejected\" '.$complete.'>Rejected</option>"); $(".misc-pub-section label").append("'.$label.'"); }); </script> '; } }
Note: You can change the post status to anything you need from the code. We have given Rejected as the status, you can replace it with anything like In Progress, Need Correction, Not completed, Pending posts, etc.
[4] Once the code is added, save the code in the theme editor and get back to any post. [5] Now you can see a status section with the dropbox holding the statuses which you have added in the code before. [6] If you save the post with any of the statuses then you can see the section added as breadcrumb above your list of posts.Note: Before making any change in your WordPress theme editor manually make sure to backup your WordPress site to avoid any data loss.
How to Create Custom Post Status/Type on WordPress With Plugins
[1] From the plugin section, Search for a plugin named Edit Flow by clicking on Add New. [2] Click on Install Now to install the plugin in your WordPress. [3] After installation, Activate the plugin and then Open the Edit Flow section from the dashboard. [4] Here click on Edit Statuses under the Custom Statuses section. [5] This will automatically create three Post status types like Pitch, Assigned, and In progress. [6] Apart from this, you can also create your own statuses by clicking on Add New section from the left side of the Edit flow page. [7] Once all the details are added, click on Add New Status and it will appear on the right side among the list of other available post statuses. [8] Now you have successfully added the custom post status on your WordPress.Related: How to Add Load More Posts Button in WordPress
How to Add/update Post Status or Type on WordPress
- From your Post editor or Gutenberg Editor, click on the Status section and select the needed status.
- You can also add post status quickly by clicking on Quick Edit below the post and set the required post status.
Conclusion
These are some of the possible ways to add post status or type for your WordPress post. You can use either of the ways to make this happen but in our opinion using the plugin is the most effective way to add post status on your site. Hope this guide helps you arrange and organize the posts in a perfect manner. If you have any doubts make use of the comments section below. For more updates and articles on WordPress, explore the blog.