How to Manage Outbound Links via Simple PHP Code

hedgehog-mascot

It is a good idea to manage outbound links, i.e links by which your users leave your blog. Using a simple PHP code even a beginner blogger is able to generate extra page views this way. With some extra coding the information can also be used to create statistics about the behavior of your website’s visitors.

Create link.php File

But for now, let’s just create a file called link.php. The best way to do this is to use Notepad++, but you can use any text editor. Just remember to save the file without any formatting.

Add the following lines of code to the file:

Save the file and upload it to the root folder of your FTP server. To do this use your favorite FTP software. The program that I use and recommend is WinSCP.

Use Special Link Syntax

With file.php in place, use this link syntax anywhere on your website:

Use the full URL of the target destination of your link after the question mark. If you want the link to open in a new tab, use target=”_blank”. If you want the link to show a title when you hover the mouse over it, use title=”Your Text Here”.

As I said — this solution is easy and efficient. You can try it here: How-To Tutorials at stosu.com.

Final Thoughts

Let me know in the comments below whether you found this tutorial helpful. And whether you were able to apply outbound links management on your blog.

Liked this post?

Subscribe to our newsletter to receive early notification of new posts and deals:

Next Post »« Previous Post

Leave a Reply

Your email address will not be published. Required fields are marked *