Adding Meta Data to your WordPress sidebar

The sidebar of a website, although traditionally used for navigation links and ads, can be used for any data you would like to place there. The most common use in WordPress is to display other posts links, archives, and categories for further navigation into the site. You can, however, use the sidebar to put anything you want, known as meta data. This requires no special function calls and needs only basic HTML and CSS. The instructions below demonstrate how you can add this meta data to your WordPress sidebar.

  1. Log into your WordPress Admin dashboard.
  2. Once logged into the Admin area, look to the left hand menu and click on the Appearance menu category. This will reveal several sub-options. Click on the Editor option to continue.
  3. You are now on the main Editor page for all php and css files for your theme. Look to the menu on the right-hand side, scroll down until you see the Sidebar option. Click on that link to open the sidebar.php file in the editor.
    select editor menu option

  4. This opens the sidebar.php file into an on-screen editor where you can edit the code and add anything you want. As stated, you can add anything you want, so with this example, we will simply add a paragraph about the site, which in this case is about dog training.

    <p class="aboutsite">Love training dogs? Want to learn about training dogs? Join us!
    This site is dedicated to those who love dogs and dog training.</p>

    Note: The two lines above should be written as a single line.

    add meta code to file

  5. After entering your data, click on the Update File button to save the new changes to the sidebar.php file. The new information will now display on the site. Below is a sample of how the code above displays. The example shows two samples of the code. The top one is exactly as it is in the code block above and the bottom sample is with some CSS added to customize how it appears.
    meta data display sample

Was this article helpful? Let us know!