Blogging is one of the basic features of WordPress. Apparently, Posts and/or Pages section in Admin Screen is where most users spend their time on. In this tutorial, we will go through 2 simple steps on how to add a custom column to WordPress pages and posts table in order to provide the extra information to our users.
Step 1 – Register the hooks to add the column
Great! It’s super easy, isn’t it? Next step, we will add some HTML element including one checkbox and a link for each row in our custom column.
Step 2 – Generate the row content
We complete this step thanks to two actions mange_posts_custom_column and manage_pages_custom_column that return two parameters $column and $post. We will compare the $column value is same as our custom column name and generate some HTML element then.
Similarity, the below code applies to the page:
Cool! Here is our result for the above snippet:
With just two simple steps, we can easily create a custom column to WordPress pages and posts table. I hope you can use it to create more advanced features for our WordPress users. If you enjoy it, please subscribe for more useful WordPress tips.