Recovered WordPress installation (on localhost) links broken and images not showing

edit mode

I initially had a wordpress installation on a free hosting service. After the hosting suffered an attack I got a backup of all files and the database and am recovering the site on my localhost (using wampserver 3.1.0 on windows 10) before I can update it and upload it to my new hosting service.

The thing is, links are not working and some (not all) images are not displaying, not even on edit mode, and not at all (I mean, there is not a square indicating a broken image either). As for settings, I set up my wordpress url and site url (in admin console) to point to my new localhost url (http://localhost/b17_14344318). I also used Search-Replace-DB to replace all instances of my old url with my localhost url (the problems existed before I replaced the url using this script).

An example of images issue is a facebook logo image I had in my old installation. As it wasn’t showing up I tried removing it from my post and re-adding, editing it (on wordpress), deleting it and re-uploading it, changing the file name and re-upload to use this “new file”, removing the html code and re-writing it… I also disabled my plugins one by one, and checked if the image showed up, but it didn’t. This image (as others that have the same problem) did show up when my site was up on its old hosting service, with the same plugins I have now (however, the WordPress version I’m using now is newer than the one I had on that hosting).

After I add the image through the “add media” button, this is the code it generates:

<a href="http://localhost/b17_14344318/2543-2/fb_logo/" rel="attachment wp-att-2549"><img class="alignnone size-full wp-image-2549" src="http://localhost/b17_14344318/wp-content/uploads/2018/08/fb_logo.png" alt="" width="215" height="215" /></a>

I tried creating a new page, just in case something was corrupt in the old page I recovered from the backup, but the image is still “invisible”. This is how it looks after I add the image through “Add media” button:

And this is the html code behind it:

As for links, when clicking on any item (link to a post, a page, a category, etc) I see this un-styled page:

Any ideas on what else I should try?

Read more here:: Recovered WordPress installation (on localhost) links broken and images not showing

Leave a Reply

Your email address will not be published. Required fields are marked *