How to Add And Customize Admin Columns in WordPress: Step-by-Step Guide

How to Add And Customize Admin Columns in Wordpress
How to Add and Customize Admin Columns in WordPress

WordPress is a popular website builder. Many people use it to create websites. It is easy to use. One important feature is the admin panel. This is where you manage your site. Admin columns help you see important info. You can add and customize these columns. This guide will show you how.

How to Add And Customize Admin Columns in WordPress: Step-by-Step Guide

Credit: www.wpbeginner.com

What Are Admin Columns?

Admin columns are in your WordPress dashboard. They show information about your posts, pages, and more. You can see details like author, date, and categories. You can add more columns. You can also change how they look.

How to Add And Customize Admin Columns in WordPress: Step-by-Step Guide

Credit: www.smashingmagazine.com

Why Customize Admin Columns?

Customizing admin columns helps you manage your site. You can see the info you need quickly. This saves time. It also makes your admin panel more useful. You can show custom data. For example, you might want to see product prices in a shop.

How to Add Admin Columns

You can add admin columns using code or plugins. We will look at both ways.

Using Code

Adding admin columns with code needs some basic knowledge. You will need to add code to your theme’s functions.php file.

Step 1: Open functions.php

Go to your WordPress dashboard. Click on Appearance. Then click on Theme Editor. Find and open the functions.php file.

Step 2: Add Code to Create New Columns

Copy and paste the following code into your functions.php file. This code adds a new column for the post ID.


function add_custom_columns($columns) {
    $columns['post_id'] = 'Post ID';
    return $columns;
}
add_filter('manage_posts_columns', 'add_custom_columns');

Step 3: Fill Your New Column with Data

Now, you need to fill the new column with data. Add this code to your functions.php file:


function custom_column_content($column, $post_id) {
    if ($column == 'post_id') {
        echo $post_id;
    }
}
add_action('manage_posts_custom_column', 'custom_column_content', 10, 2);

Save your changes. Go to your posts list. You will see the new column with post IDs.

Using Plugins

Plugins make adding admin columns easier. There are many plugins. One popular choice is Admin Columns. Follow these steps to use it:

Step 1: Install the Plugin

Go to your WordPress dashboard. Click on Plugins. Then click on Add New. Search for Admin Columns. Click Install Now. Then click Activate.

Step 2: Configure the Plugin

Go to Settings. Click on Admin Columns. You will see a list of content types. Choose the type you want to customize. For example, choose Posts to add columns to your posts list.

Step 3: Add a New Column

Click on Add Column. Choose the type of column you want. For example, choose Custom Field. Enter the details for your new column. Click Save.

How to Customize Admin Columns

Customizing admin columns means changing how they look. You can also change what they show. Let’s see how to do this.

Reorder Columns

You can change the order of columns. To do this with code, add this to your functions.php file:


function reorder_columns($columns) {
    $new_order = array(
        'cb' => $columns['cb'],
        'post_id' => 'Post ID',
        'title' => $columns['title'],
    );
    return $new_order;
}
add_filter('manage_posts_columns', 'reorder_columns');

Save your changes. Your columns will be in the new order.

Remove Unwanted Columns

You can remove columns you do not need. Add this code to your functions.php file:


function remove_unwanted_columns($columns) {
    unset($columns['author']);
    unset($columns['comments']);
    return $columns;
}
add_filter('manage_posts_columns', 'remove_unwanted_columns');

Save your changes. The unwanted columns will be gone.

Adjust Column Width

Sometimes, columns are too wide or too narrow. You can adjust column width with CSS. Add this code to your theme’s style.css file:




Save your changes. The column width will be adjusted.

Frequently Asked Questions

How To Add Admin Columns In WordPress?

Go to the “Admin Columns” plugin. Install and activate it. Configure your columns.

Can I Customize Admin Columns In WordPress?

Yes, you can. Use plugins like “Admin Columns. ” Customize with drag-and-drop features.

What Are Admin Columns In WordPress?

Admin columns display extra information about your posts, pages, or users. They improve content management.

Why Use Admin Columns In WordPress?

They help you view important data at a glance. This simplifies your WordPress dashboard.

Conclusion

Adding and customizing admin columns in WordPress is useful. It helps you see important info quickly. You can do this with code or plugins. This guide showed you both ways. Now you can make your admin panel more useful. Happy managing!

Thank you for reading. We hope this guide helps you. Have a great day!

Leave a Reply

Your email address will not be published. Required fields are marked *

Iqbal hossen Juel

A seasoned marketing professional with over a decade of experience in digital and traditional marketing. Currently serving as Digital Experience Lead at Starcom, He brings a unique blend of strategic marketing expertise and technical knowledge to the table. With a passion for programming and design, he offers a distinctive perspective that bridges the gap between marketing strategy and technical implementation.

Our Review Process:

We test and review software products based on an independent, multi-point methodology. If you use our links to purchase something, we earn a commission. Read our editorial process and disclosures.

Ultimate Collection Of

Business Tools

A collection of business related Tools and resources that every business owner should have!

Table of Contents

Related Posts

Best Ai Chatbot
Best Ai Chatbot: Revolutionizing Customer Engagement
Best AI Chatbot What is an AI Chatbot? An AI chatbot is a computer program. It talks with humans using...
Read More
Best Comic Making App
Best Comic Making App: Unleash Your Creativity Today!
Best Comic Making App Do you love comics? Do you want to make your own? Today, we will talk about the...
Read More
Content Optimization: Boost Your Rankings with Proven Strategies
Ever wonder why some pages skyrocket on Google while others flop? Content optimization is the secret...
Read More
Best Clothes Editor
Best Clothes Editor: Transform Your Wardrobe Instantly
Best Clothes Editor Editing clothes in photos can be fun. It can also be useful. Many apps and tools...
Read More