Try to install and activate the “Better Search Replace” plugin.
Once activated, go to Tools -> “Better Search Replace” in your WordPress dashboard.
Then, in the ‘Search for‘ field, enter your old domain name (e.g., oldsite.com
), and in the ‘Replace with‘ field, enter your new domain name (e.g., newsite.com
).
Select all the tables (or at least the posts table, if you’re sure that’s where the issue is) and run a search/replace.
It’s best if you do a ‘dry run‘ first, which will show you what changes the plugin will make without actually making them. This is a great way to double-check that you’re replacing the right thing.
And if you’re satisfied with the dry run results, uncheck the dry run option and run the actual search/replace.
By the way, before doing all that, I strongly recommend that you backup your database first. This way, if something goes wrong while you’re in the middle you will always have a restore point to go back to.
I hope this helps!