How to Audit Your Affiliate Links – Find Broken URLs in WordPress and Fix Them

If you use a lot of affiliate links in your WordPress site, you will find over time that they will become broken – this is down to websites changing their URLS, swapping affiliate management to different systems and discontinuing products etc. It’s quite an annoying problem to deal with as not all companies will notify you or you miss the email that they might send out.

That’s why it makes sense to audit your affiliate links every now and then, if you have just pasted the affiliate links directly into your posts, this can be a problem so I recommend that you use an affiliate link manager plugin to handle them. One such plugin is Thirsty Affiliates, I also listed a few more in my post “Monetize your blog with Affiliate links, Plugins & Advice“.


Most plugins will save redirected URLS to your .htaccess file which is how we will get a list of URLS we can test, read on to see How to Audit Your Affiliate Links.

Get a list of Your Affiliate URLS

The first thing to do is download a copy of your .htaccess file which is located in your website root folder ( public_html ) and locate the affiliate redirected links, which will look like this :

Redirect 302 /8bitlivetheme
Redirect 302 /academiablackboard
Redirect 302 /academiafoundation
Redirect 302 /academialectura
Redirect 302 /academiaprincipal
Redirect 302 /acosmin

Now you will want to extract the actual URLS so you can test whether they are live or broken, to do this I found this tool called URL extractor which let’s you paste in some text and it will extract all the URLS and make them links.


Once you have the URLS, copy and paste them into a blank file and name it something with a .html extension, upload this somewhere online to your website where it can be accessed and you can then test them.

Test the URLs for Dead Links

To check your list of URLs for dead links, visit Dead Link Checker and enter the URL of the file you created with all your affiliate URLS listed. Choose “Quick Scan” which only checks the URLS in a single web page, choose “automatically retry dead links 2 times” and click the “check” button and it will begin scanning your links for you.


Depending on how many links you have to check, this process may take a while so leave it running and eventually you will get a report which lists any broken URLs, like so:


Some of the errors could be 400 (Bad Request), 404 ( Page Not Found ), Timeout or Not Found. You should save the list of bad URLS and then manually go through them by hand and see what the problem is. Out of 748 links and the checker found 115 with problems – I checked and the timeouts were ok, the site was just taking a while to respond so I left those links as they were.

Others, the website was gone so the affiliate program was also closed – some of the 404 errors were companies which had changed their affiliate system.

After finding all the links where the website had closed and the ones where the affiliate program had changed, its a good idea to signup for the new affiliate program and change the links over in your link manager. For the ones where the website had closed, you can go and delete the links in your posts to that, or if there is a similar website / link you can simply swap them over to something else.



Oliver Dale is the founder of Kooc Media, An Internet Company based in Manchester, UK. I founded WPLift and ThemeFurnace, find out more on my Personal Blog. Thanks!

Related Articles


learn wordpress wplift icon

Learn The Inner Workings Of WordPress,

Even If You Don’t Know How to Code...

Join Our 30,000+ WordPress Aficionados, From Newbies To Experts, And Power-Up. Your WordPress Site With The Best Plugins, Techniques and Tricks.