Using Your Blogroll to Manage Text Ads

If you’re a web code expert (or even novice) you can probably handle hard coding in sponsored links in your blog’s sidebar. But many people are unaware that you can manage text ads via your WordPress administration panel. It’s a small tweak/hack, but once you have it in place, adding and removing sponsored text ads will be a breeze from then on.

The first thing you’ll want to do is log into your WordPress administration panel. Click on “Manage” in the top-level navigation, then click on “Categories” in the sub-navigation. This is where you need to add a new category. For the purposes of this article, we’ll call it “Ads”.

After you add the new category, take a look in the list and find the Category ID (that will be located in the far left column). Once you have the category ID, we can move on to…

…The blogroll. Click on the “Blogroll” link in the primary navigation bar of your WordPress admin panel. Click “Add Link” in the sub-navigation.

Now you should have a form to fill in. Essentially, you’ll want make the “Name” the actual text you want to appear in your sidebar (the anchor text). After that, fill in the URL you want to link to. Go ahead and leave the “description” field empty.

Just before you submit the form, take a look to your far right. There, you’ll see a list of categories (probably only “Blogroll” and “Ads”). Uncheck the “Blogroll” category and check the “Ads” category. NOW you can submit the form.

Here comes the tricky part (depending on whether or not you like to edit WordPress theme files). Open your sidebar.php (or whatever your sidebar file is called) and create a new space. For the purposes of this article, I’ll use a standard widgetized sidebar format for my new list. You’ll basically want to add this (or something similar):

<h2>Sponsored Links</h2>
<?php get_links(8, ‘<li>’, ‘</li>’, ‘ – ‘); ?>

I’m not going to go into the explanation of this Template Tag, so for more information on that, go here.

I will, however, explain the “8” inside the parenthesis. The “8” represents the category ID we want to be displayed. Remember back when I told you to locate the category ID of the new category you added? That’s what will go where the “8” is in my code, so replace the “8” with the category ID you have.

The output will be a list of links that you place in that category. This gives you a quick and easy way to manage sponsored links, or any kind of link really.

Be sure to check out all the other cool things you can do with the get_links template tag. Use you imagination and you can come up with anything!

Happy Coding!

7 thoughts on “Using Your Blogroll to Manage Text Ads

  1. thebutler,
    What do you mean by “examples”? Do you mean a working example of what the links would look like in an actual theme, or source code examples?


  2. Nathan, thanks for the hack. I’m not the most php savvy guy. Can you put up a link that shows any example so I know whats its supposed to look like once its done.

  3. I can’t believe I never thought of this before. I’ll definitely be using this method for advertising sites on my blog. I much prefer to have my own advertising program than use something like AdSense.

    Though until my blog becomes a little more popular, running my own advertising program won’t work as well as I’d like it to.

  4. Hmmm.

    Doesn’t the plugin add text links automatically to the sidebar?

    $200 is too high, I agree.

    But if it were for, say, $19, and it had some good extra features, then why not?

  5. alverett,
    Of course, there is always a plugin or a widget for these kinds of things. But we don’t need no stinkin’ widget! 🙂

    Just kidding. You’re exactly right. Just do what I did in the first part of the article, then instead of editing the template, just use that widget (if you’re into that kind of thing).

  6. Raj,
    You’re exactly right. A contact form, a paypal account and a little elbow grease can go a long way.

  7. No need to spend $200 or whatever for that link selling plugin. You can hack it together with existing features and a contact form

Comments are closed.