There are a few potential solutions you can try:
- Consider using WP-CLI for media import purposes: https://developer.wordpress.org/cli/commands/media/import/
- The plugin Add From Server should allow you to import media files that are already uploaded via FTP directly into your media library.
- Database Repair: Database inconsistencies or corruption can also cause issues with media files not showing up in the library. WordPress has a built-in database repair feature that you can use to attempt to fix any issues. You can add the following line to your
wp-config.php: define('WP_ALLOW_REPAIR', true);
After adding this line, you can access the repair page by visiting http://yourdomain.com/wp-admin/maint/repair.php. Remember to remove the line from wp-config.php after you’ve finished repairing the database for security reasons.
Thanks. I already have Add from Server. Further investigation revealed that quite a lot of uploads had disappeared and I have reloaded them from backup so Add From Server may well be useful now. I will also try the repair tool.
Trying the repair advice. I have added the line suggested but on then browsing to
http://oldmaidstonians.org.uk/wp-admin/maint/repair.php
I just get a box telling me
=========
To allow use of this page to automatically repair database problems, please add the following line to your wp-config.php file. Once this line is added to your config, reload this page.
define('WP_ALLOW_REPAIR', true);
===========
I did that but it just gave me that box again. What am I doing wrong e.g. do I need to be logged in somewhere as a site admin to make this work?