Support » Fixing WordPress » Media Library in post won't load images – calls admin-ajax.php constantly

  • I am now running 3.9, but the problem started under 3.8.3 – I had hoped upgrading would fix it but no luck.

    Issue: When editing a post and clicking ‘add media’ trying to use existing media from the Media Library simply makes ajax calls to admin-ajax.php over and over, but doesn’t load the images from the media library.

    I have a live site and a development site, I can get both to show the same problem but under different circumstances. Live-site does not load images under normal conditions and under wp-debug=true conditions. Development site loads images under normal conditions, but does not load images under wp-debut=true conditions.

    When watching the console I see the admin-ajax.php file called over and over but it is not loading images. I assume this to be a javascript problem, but I have no java script errors that I can find.

    I have tried deactivating all plugins, and switching back to default themes. Same situations occur under all conditions, strangely enough.

    I am running on GoDaddy cloud servers, and have read there may be issues there with the admin-ajax.php file.

    Previously had the same issue but it went away after clearing a caching plugin – that has not worked this time around.

    Any advice would be much appreciated.

Viewing 15 replies - 16 through 30 (of 51 total)
  • Thanks!!! OMG!

    WP Calendar broke it for me…

    Hey, just reporting in that what worked for me was defining WP_SITEURL in wp-config. I previously had it defined then removed — that’s when I started having this issue.

    in wp-config.php:
    define(‘WP_SITEURL’, <your_site_url>);

    I just had this problem after updating to version 4.0.
    Not sure if my solution will work for everyone but..
    I went to the menu Media and changed the view from grid to list.
    Then went back to my posts and I could load images!

    Maybe just a coincidence?

    My Media library in blog listing shows all almost 4000 images. But when i change to grid view suddenly it shows the same as modal box in Posts, only some specific number, and stuck on the same image at the end.

    I have two websites with this problem now. Both converted from Joomla, but as blog listing in media library shows them all i guess images are OK.

    I had the same issue, images wouldn’t show in the media library or in the media uploader in posts, but when I changed to the media library “list” view I could see them.

    Turns out we were adding a bunch of custom fields to media attachments (not in a plugin, just in our functions file), and it looks like wordpress was running out of memory, because if we removed all but a couple fields, everything was fine.

    We added ini_set('memory_limit', '64M'); to our wp-config.php file and all is well.

    It didnt help in my case. Have lot of memory (localhost).

    My problem is not server resources because when i search for images in modal box all images are listed.
    (all images have “k” in filename, so it is easy to list them all via search)

    Some update. Didnt hit me to check new 4.0 option of unattached images (select drop down).

    So this option list all non attached images, as media library rightly report them.

    Problem is only with attached images as WordPress logic sees them.

    – All media items (doesnt work)
    – Uploaded to this post (works)
    – Images (doesnt work)
    – Video, Audio (works)
    – Unattached (works)

    Can someone from core team take a look at this. Seems as some part of core code, few lines maybe, is not so robust and stable.

    First website:
    752 attachments.
    – List in media library shows them all (with pagination of course, but if i in Screen option chose 752 as number, all are shown too)
    – Media grid library shows only 119 attachments (precise as listing in post modal box)

    Second website:
    3903 attachments.
    – List in media library shows them all
    – Media grid library shows only 159 attachments (precise as listing in post modal box)

    I did it again, just to be sure and not to call upon core team for no reason.

    – Core and everything else updated to latest.
    – Deactivated all plugins.
    – Wp-config.php clean.
    – .htaccess clean, same problem with it or without it.
    – Changed to Twenty Fourteen theme (clean functions.php too)
    – Absolutely same problem.

    Very strange phenomenon.

    I am seeing the same issue on a client’s site hosted on my server. Her site is the only one seeing this issue. Checked all plugins, theme, and tried adding the ini_set(‘memory_limit’, ’64M’); line to wp-config, as well as tried adding define(‘WP_SITEURL’, <your_site_url>); to wp-config…. no results.

    This has to be the strangest issue i have seen with a wp site over the last few years. The search for answers continues…

    Use this plugin to disable loading of plugins (all) in admin panel. Good for troubleshooting, you can disable/enable them with one click, without messing with real plugin activation.

    https://wordpress.org/plugins/plugin-organizer/

    Just in settings of Plugin Organizer enable plugin for admin part.

    Now third website with same problem. This one is clean, no Joomla convert.

    Can it be something with image file names ?

    Pretty sure I’m having the same problem on a clean install. Can’t for the life of me figure out why. Images show perfectly in list view (which is a pain to navigate) but only a handful show up in grid and spinner just keeps on spinning till it seems to time out.

    Has anyone got any ideas on this yet?

    Has to do something with server configuration. Believe in my case anyway.
    One of my websites on live server doesnt have that problem, but on localhost it has.

    So even for you with problems on live server it easy could be same, server settings.

    And now it is pain in the ass to find why. Changed WAMP platform, changed all server versions. Changed lot of Apache/PHP settings forward and back, nothing helped. Activated/deactivated Apache modules.

Viewing 15 replies - 16 through 30 (of 51 total)
  • The topic ‘Media Library in post won't load images – calls admin-ajax.php constantly’ is closed to new replies.