Due to some recent security breach, I had to replace my website on the server with all the new local files.

Question: Now I see "http://localhost:8888/" string in my blog posts ( e.g. image sources and everywhere else) due to which the website is not working properly.

I have already generated fresh permalinks Settings->Permanlinks->Save

How can I replace "http://localhost:8888/" with "mysiteurl.com". Is there any script?


1 Answer 1


You'll need to fix the URLs in the database. Although you can do it with MySQL commands, the easiest way I've found is with the "Better Search and Replace" plugin. Easy to use, and works.


Of course, backup your database first. But it works quite well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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