Support » Fixing WordPress » Links list – target=”_blank”?

  • Is there a way that I can make my links from the link lists open in a new window? I know that I can do it with ordinary links but not sure about doing it with the .css. Do I just alter the index.css manually or is there a neater way?

Viewing 15 replies - 1 through 15 (of 17 total)
  • Mark (podz)


    Support Maven

    The css doesn’t do anything here.
    You’ll have to make each link look like this:
    Link to external site
    There is a lot more to read on this here:

    When you add a link via WordPress admin area, there is a radio check button near the bottom for target. You only have three choices, but you could always edit the MySQL table directly.
    I learnt the hard way but if the target is “blank” then the first link you click opens in a new window and all the others open in that window. Targets with “_blank” ALL open in new windows.
    Hope that helps.

    Cheers guys, can’t believe I managed to miss the target button at the bottom of the screen!!



    How can I set the default to _blank?
    How do I bulk update all my links to be _blank?
    Wish List:
    1. Hide target on Status line
    2. There are great linking programs out there. From affiliate programs to reciprocal links. It would be great to have these types of options.
    Awesome program!

    Hi guys. I know the target=”_blank” option is at the bottom of the “add links” page, but I have the same questions as mlieb above, how can I make it select target=”_blank” as default? As I add a lot of links to my links page I’d like to not have to scroll all the way down to select this option every time I add a link.

    Thanks in advance for any help. I’ve tried to look into the links related php files in the admin folder but had no luck.

    I believe you’ll have to hack the WP code to change the default behaviout. Assuming you’re using WP2, the file edit-link-form.php in your wp-admin directory will need to be changed at around lines 234 and 237, where the checked="checked" is being set.

    pizdin_dim, thanks! I am close. I’ve found the code (Yes WP 2.0.3) but can’t figure out what to do next!!!

    <input type=”radio” name=”link_target” value=”_blank” <?php echo(($link->link_target == ‘_blank’) ? ‘checked=”checked”‘ : ”); ?> />_blank</label>

    <input type=”radio” name=”link_target” value=”_top” <?php echo(($link->link_target == ‘_top’) ? ‘checked=”checked”‘ : ”); ?> />

    <input type=”radio” name=”link_target” value=”” <?php echo(($link->link_target == ”) ? ‘checked=”checked”‘ : ”); ?> />
    <?php _e(‘none’) ?></label>

    Any help would really be appreciated!

    Just reshuffle the order so the code for “_blank” is last, not first.

    Thanks so much for the help. Really appreciated. was so excited to try it but alas it’s still not working. All that did was shuffle it around but the default was still “none”.

    Just as a tip, a lot of people find links opening in new windows quite annoying. I know it’s a way to encourage your users to stay on your site, but quite often it has the oppposite effect, since it looks a bit like a popup.

    The best way to keep users on your site is to have great content 😉

    Thanks Maerk. I’ve thought long and hard about it and believe that since we are a launch pad kind of site, that it’s best to launch links to elsewhere in new windows.

    People have the option of right clicking and launching in a new tab if they prefer, or can automatically set windows which target blank to a new tab within Firefox.

    All that did was shuffle it around but the default was still “none”.

    Are you sure? If you’re editing an exiting link, it will use the stored value, try changing it, save the record and edit again. Also, try creating a new record. I think you’ll find what I said is correct.

    Thanks for taking the time to reply again pizdin_dim.

    I tried it once more and again it’s just re-shuffled the options around but “none” is still being selected as the deault.

    My code now looks like this:

    <input type=”radio” name=”link_target” value=”” <?php echo(($link->link_target == ”) ? ‘checked=”checked”‘ : ”); ?> /><?php _e(‘none’) ?></label>

    <input type=”radio” name=”link_target” value=”_top” <?php echo(($link->link_target == ‘_top’) ? ‘checked=”checked”‘ : ”); ?> />_top</label>

    <input type=”radio” name=”link_target” value=”_blank” <?php echo(($link->link_target == ‘_blank’) ? ‘checked=”checked”‘ : ”); ?> />_blank</label>

    I can see the shuffle of order in my admin page when I’m on the ad link page. So I know that the change of order is working. Just can’t figure out exactly what is setting “none” to be selected as the default!

    How’s this for strange too, I deleted the options for “_top” and “none” so that the only option I get is “_blank” and it’s still not selected!

    Sounds like you haven’t changed the existing link record to “_blank”. Put those three radio buttons back, then change an existing link record to “_blank”, then edit the same record again. I think you’ll find it will the default to “_blank” as it conditionally sets each radiobutton to “checked”, depending on the current value it gets from the database.

    If it still doesn’t work, then the record is not being saved for some reason.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Links list – target=”_blank”?’ is closed to new replies.