How to fix a media upload error in WordPress

Media upload errors in WordPress usually happen because of server limits, incorrect folder permissions, plugin or theme conflicts, or security rules. Use the steps below to identify and fix the problem.

Check File Size and Format

Start by making sure the file you are uploading is smaller than your site's maximum upload limit and is in a supported format such as JPEG, PNG, GIF, PDF, or MP4. If the file is too large, compress it or resize it. This alone can resolve many upload errors.

Increase PHP Upload Limits

Your hosting server may have limits that prevent large uploads. You can increase these limits by updating server configuration files.

If you have access to php.ini, increase values like:

  • upload_max_filesize

  • post_max_size

  • memory_limit

If you cannot edit php.ini, you can adjust the same settings in .htaccess, or increase the memory limit in wp-config.php.

Check our detailed guide on how to modify PHP values from your cPanel account

Check File and Folder Permissions

Incorrect permissions inside the wp-content/uploads directory can stop WordPress from saving uploaded files. Use cPanel file manager to check this folder. It must be writable by the server. Common settings are:

  • Folders: 755

  • Files: 644

Make sure the server user has permission to write to the uploads folder and its subfolders.

If not, you can change the permissions by following the steps in this guide 

Verify the Upload Path

In WordPress dashboard, go to Settings > Media and check the upload path. If a custom path has been added there, remove it and allow WordPress to use the default path (wp-content/uploads).

Confirm that the folder exists and that WordPress can write to it.

Disable Plugins and Switch Themes

A plugin or theme conflict may block media uploads. Temporarily deactivate all plugins and switch to a default theme, then try uploading again.

If the upload succeeds, reactivate your plugins one by one to identify the one causing the issue. After that, switch back to your main theme.

Clear Cache

If you use a caching plugin, clear its cache and try the upload again. Also clear your browser cache or use another browser to avoid cached errors.

Use Debug Logs

To identify the exact cause of an upload error, enable WordPress debugging by adding the following to wp-config.php:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Attempt your upload again and then check the file wp-content/debug.log. You should also check your server’s error logs through your cPanel.

Update PHP and Contact Hosting Support

Make sure your site uses a current and supported version of PHP. Many older versions can cause memory problems and upload failures. If the problem continues, feel free to contact our support team.

Summary

Most media upload issues can be resolved by checking file size limits, increasing PHP memory or upload limits, fixing permissions in the uploads folder, resetting the upload path, clearing caches, or resolving plugin and theme conflicts. If none of these steps work, review your logs or contact your hosting support team for assistance.

How to fix a media upload error in WordPress