Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Remove broken external links in post_content? WordPress


I need to browse a wp DB and remove the external broken links in posts.

There should be some basic checking to accept non-200 results that redirect to a page whose original slug has nothing to to with final destination's, to prevent redirections to casino and other spam sites.

If the links don't pass the test I need to replace them with their anchor text (same thing, no link).

I think "Hey, I can do it myself!" (self-taught php) but I'm sure it'd end up taking me two days, as you could in 2 min :)

Please answer with actual php code for wordpress, not concepts nor to-do comments.

Answers (1)


Francisco Javier Carazo Gil answers:


Have you tried this plugin?