0

I have website what contain hundreads articles. is there some way, how to remove all external links from all posts by one click/script?

1 Answer 1

0

You can do this by a SQL query, example:

UPDATE wp_posts
SET post_content = CONCAT(
    LEFT(post_content, LOCATE('<a', post_content) - 1), 
    SUBSTRING(post_content, LOCATE('</a>', post_content, LOCATE('<a', post_content) + 2) + 4))
WHERE post_content LIKE '%<a%';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.