Eric Wood
Eric Wood

Reputation: 589

Wordpress Images not displaying

For some reason, all of my wordpress images stopped displaying. I've tried disabling all plugins, and reverting to twenty-twelve theme, but still nothing.

When I login to the dashboard and go to the Media Library, this is what I see:

Media Library

But when I click on one of the images, and go to its path, the image URL will load the image.

It almost seems as if Wordpress has disconnected itself from my uploads folder?

Lastly, on my homepage, when I right-click on the broken image link for my logo (that's not displaying), and choose "Open image in new tab", it doesn't actually return the image URL. It returns:

http://127.0.0.1/

Has anyone else come across this before? I have no idea where to begin solving this, as it doesn't seem to be associated with my theme, or my plugins, and my Wordpress core is up to date.

Any help would be much appreciated. Thanks!

Upvotes: 0

Views: 10796

Answers (2)

DACrosby
DACrosby

Reputation: 11440

The change the the htaccess file that you mentioned in a comment is likely the cause. This is not part of WP Security plugin. Since you have that security plugin installed, you hopefully made a restore point of your htaccess file and should be able to get a good copy back quickly - it's one of the plugin's features.

Details here: https://www.tipsandtricks-hq.com/how-to-restore-the-htaccess-file-when-using-the-all-in-one-wp-security-plugin-5945

If you need to redo the file via FTP instead, here's a list of the most likely htaccess file content, derpending your site's exact needs: http://codex.wordpress.org/htaccess

Probably, it should look like ths:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Upvotes: 1

nunorbatista
nunorbatista

Reputation: 875

It can be a hack, but this generally happens when your wp_options are not correctly configured.

Quick way to solve: Restore a backup to a previous working condition.

If you don't have a backup or want to check other options, try this:

  1. open phpmyadmin in your live server and access the Wordpress database;
  2. Inside the Database, access the table wp_options;
  3. Check the values for the rows 'siteurl' and 'home'.

EDIT: Method 2 - re-create .htaccess

  1. Rename your .htaccess to htaccess_
  2. Go to Wordpress Settings -> Permalinks
  3. Select the default type and Save, this should create a new .htaccess
  4. Open the homepage of website and check if it changed something
  5. Return to Permalink Options and select the way you had it before

Upvotes: 0

Related Questions