Forums

Change links (2 posts)

  1. ruicruz
    Member
    Posted 2 years ago #

    Hello,

    I've a script to get a count and more browser informations from who click on link "X".

    But I dont want to add this www.site.com/link.php?ref=<url-here> each time I create a link.

    So, I'm wondering if there is an automatic way to change the WP code to automaticly insert it on each outsite link.

    If there is, tell me. :)

    Rui

  2. Kafkaesqui
    Moderator
    Posted 2 years ago #

    Seems a plugin would come in handy for something like this...

    Prefix Post URLs
    Download plugin | View source

    It has a single user-configurable variable you should know about:

    $prefix = This is a string variable providing the text you want to prefix to any external url. The default value is '' (empty). You'd want to change this to something like the following:

    $prefix = 'http://www.site.com/link.php?ref=';

    You can edit the variable either through the Plugin Editor in WordPress, or in a text editor off-line.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags