• How do I add “rel=nofollow” to specific links (but NOT all of them) in the blog roll to keep from passing page rank to the linked site? Whenever I try to type anything in the “rel” field on the link edit page (wp-admin/link.php?link_id=22&action=edit), some sort of form validation script backs out whatever I type in as soon as I type the first letter.

Viewing 13 replies - 16 through 28 (of 28 total)
  • whooami

    (@whooami)

    I didnt doubt Moshu. I’m simply saying I JUST did it, complete with screenshots.

    aha! OK!! I know what it is ??

    I use noscript!!

    hence the difference.

    well anyway, its fixed in 2-1/2, isnt that days away?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Yes, disabling javascript makes it work, but then also makes all the automatic XFN building code stop working.

    Looking closer at /wp-admin/js/xfn.js, this seems to be the desired behavior. Notice this:

    var aInputs = document.getElementsByTagName('input');
    for (var i = 0; i < aInputs.length; i++) {
     aInputs[i].onclick = aInputs[i].onkeyup = upit;
    }

    This sets every input field to run the upit() function on every keypress or click of those fields. upit() is earlier in the file, but basically it builds the link_rel field based on the XFN inputs.

    One solution would be to add a nofollow checkbox. This is actually very easy, given the javascript code. Just add this to edit-link-form.php, around line 113:

    <tr>
    <th scope="row"> <?php _e('following') ?> </th>
    <td>
    <label for="follow">
    <input class="valinp" type="checkbox" name="follow" value="nofollow" id="nofollow" <?php xfn_check('follow', 'nofollow'); ?> />
    <?php _e('nofollow') ?></label>
    </td>
    </tr>

    Voila. Checkbox produces nofollow code.

    I have not tested 2.5, but looking at the JS source doesn’t show much difference to me. Looks like it would have the same issue. Still, the “fix” might be elsewhere.

    Just wonder what happen to WP 2.5.1? I still have the same problem as with 2.3.3 and could not type anything to rel box. Looking at edit-link-form.php and don’t know where to put the code above. If you can tell what is in line 113 and line 114, it would be great so I know exactly where to past these codes. Thanks.

    I used wordpad and hate to count the line number. However, I put these lines of code just before these lines and got it works.

    <tr>
    <th scope=”row”><?php _e(‘identity’) ?></th>

    Thanks.

    Same here, i just added nofollow to the Rel box and you can’t type anything in there it just deletes it.

    Why is it set like this, is it a bug?

    Thread Starter minusonebit

    (@minusonebit)

    Of course, disabling java script on the browser and then inputting it should allow you to get it done.

    I still say that’s a bug and not a feature. Why would they put that java script in there? That’s a stupid UE design. If you don’t want users to edit the contents of a field, don’t give them a field to edit. You don’t give them a field and then put java script in place to back out their edits.

    Sure, now I know how to hack it by adding the check box code, but that still doesn’t change the fact that’s its a poor implementation.

    Can we get rid of this so-called “feature” of backing out edits to that box?

    I agree with minusonebit. It is really more a bug then a feature.
    And it would be very useful to have that option.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    I’ll bring up the topic on trac.

    Done: https://trac.www.ads-software.com/ticket/7485

    Thanks Otto42.
    Much appreciated!

    Hi,

    I found a solution a few months ago and I posted it in
    https://www.eduardoburgos.com/2008/05/03/write-custom-rel-tags-for-your-links-in-wordpress-251/

    It’s very similar to what Otto42 said.

    Cheers,

    Eduardo Burgos

    I’ve already got quite a few links. So going throught each and one adding “nofollow” is not an option.

    I could do it in the database, but again not the solution I’m looking for.

    I haven’t tested this yet, but here is an thought:

    Why not just use javascript FindElementById and add the atribute ‘rel’ with the value ‘nofollow’ when the links are created?

    I know it’s been a while, but I came across this plugin that appears to have a solution for everyone…and it doesn’t require any hacks.

    https://www.ads-software.com/extend/plugins/nofollow-links/

    Merry Christmas.

    Thread Starter minusonebit

    (@minusonebit)

    Here is to hoping that someday (perhaps before I die), this makes it into a future release.

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘How to Add rel=nofollow to Blogroll Links?’ is closed to new replies.