For example, <a href="http://msdn.microsoft.com/art029nr/">remove links to here but keep text</a> but <a href="http://herpyderp.com">leave all other links alone</a>
I've been trying to solve this using preg_replace. I've searched through here and found answers that solve pieces of the problem.
The answer at PHP: Remove all hyperlinks of specific domain from text removes links to a specific url but removes the text also.
The site at http://php-opensource-help.blogspot.ie/2010/10/how-to-remove-hyperlink-from-string.html removes a hyperlink from a string but I can't seem to modify the pattern so that it applies only to a specific website.
For those scared to use DomDocument instead of
preg_replace
for performance reasons, I did a quick test between this and the code linked in the Q (the one that completely removes the links) => DomDocument is only ~4 times slower.