How to Add Custom Shortcut Links to WordPress Toolbar: Step-by-Step Guide

How to Add Custom Shortcut Links to Wordpress Toolbar
How to Add Custom Shortcut Links to WordPress Toolbar

Do you want to make your WordPress toolbar more useful? Adding custom shortcut links can help. This guide will show you how to do it. It’s easy and quick. Let’s get started.

Why Add Custom Shortcut Links?

WordPress toolbar is very helpful. It gives you quick access to important functions. But, it can be better. Adding custom links to the toolbar saves time. You can jump to important pages fast.

Things You Will Need

  • A WordPress website
  • Admin access to your WordPress site
  • Basic knowledge of WordPress

Steps to Add Custom Shortcut Links

Follow these steps to add custom shortcut links to the WordPress toolbar:

Step 1: Log Into Your WordPress Dashboard

First, log into your WordPress dashboard. You need admin access to do this. Once logged in, you can start adding custom links.

Step 2: Add Code To Your Theme’s Functions.php File

You need to add a small code snippet to your theme’s functions.php file. This file controls many aspects of your theme.

Follow these steps:

  • Go to Appearance in the left sidebar.
  • Click on Theme Editor.
  • Select the functions.php file from the right sidebar.
  • Add the following code to the end of the file:

    function add_custom_toolbar_link($wp_admin_bar) {
        $args = array(
            'id' => 'my_custom_link',
            'title' => 'My Custom Link',
            'href' => 'http://example.com',
            'meta' => array(
                'class' => 'my-custom-link-class',
                'title' => 'Visit My Custom Link'
            )
        );
        $wp_admin_bar->add_node($args);
    }
    add_action('admin_bar_menu', 'add_custom_toolbar_link', 999);
    

This code adds a new link to your toolbar. Replace ‘http://example.com’ with your custom link. Change ‘My Custom Link’ to your desired title.

Step 3: Save The Changes

After adding the code, click on the Update File button. This saves your changes. Now, your custom link should appear in the toolbar.

More Customization Options

You can add more custom links by repeating the process. Just change the ‘id’, ‘title’, and ‘href’ values in the code. You can also group your links under a parent item.

Adding A Parent Item

To add a parent item, use this code:


    function add_custom_parent_link($wp_admin_bar) {
        $args = array(
            'id' => 'my_custom_parent',
            'title' => 'My Custom Parent',
            'href' => '#',
            'meta' => array(
                'class' => 'my-custom-parent-class',
                'title' => 'My Custom Parent'
            )
        );
        $wp_admin_bar->add_node($args);
    }
    add_action('admin_bar_menu', 'add_custom_parent_link', 999);
    

Now, add child items under this parent item:


    function add_custom_child_link($wp_admin_bar) {
        $parent = 'my_custom_parent';
        $args = array(
            'id' => 'my_custom_child_link',
            'parent' => $parent,
            'title' => 'My Custom Child Link',
            'href' => 'http://example.com',
            'meta' => array(
                'class' => 'my-custom-child-link-class',
                'title' => 'Visit My Custom Child Link'
            )
        );
        $wp_admin_bar->add_node($args);
    }
    add_action('admin_bar_menu', 'add_custom_child_link', 999);
    

This code adds a child link under the parent item. Replace the ‘http://example.com’ and ‘My Custom Child Link’ with your values.

Using Plugins

If you don’t want to edit code, use plugins. Plugins make it easy to add custom links. Here are some popular plugins:

Admin Bar Tools

This plugin lets you add custom links to the toolbar. It’s easy to use. Install and activate the plugin. Then, go to Settings > Admin Bar Tools to add your links.

Wp Custom Admin Bar

This plugin offers more options. You can add links, menus, and more. Install and activate the plugin. Then, go to Settings > WP Custom Admin Bar to start customizing.

How to Add Custom Shortcut Links to WordPress Toolbar: Step-by-Step Guide

Credit: www.greengeeks.com

How to Add Custom Shortcut Links to WordPress Toolbar: Step-by-Step Guide

Credit: www.wpbeginner.com

Frequently Asked Questions

How Do I Add Custom Links To The WordPress Toolbar?

To add custom links, use a plugin or edit your theme’s functions. php file.

Which Plugin Is Best For Custom Toolbar Links?

The “Admin Menu Editor” plugin is popular and easy to use for adding custom links.

Can I Add Shortcut Links Without A Plugin?

Yes, you can add shortcut links by editing the functions. php file in your theme.

Is It Safe To Edit The Functions.php File?

Editing functions. php is safe if done carefully. Always back up your site first.

Conclusion

Adding custom shortcut links to your WordPress toolbar is very helpful. It saves you time and makes your work easier. Follow the steps in this guide, and you’ll have custom links in no time. Happy blogging!

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