It is possible that when you manually upload files to your WordPress installation, you got this error: "exceeds the maximum upload size for this site". Or what is the same: that the file is larger than the maximum size allowed.
Content of this Article
¿Por qué se produce este error?
The first thing you should be clear about is that this error is not generated by WordPress, but by the hosting server where your installation is located.
Hosting providers usually set a limit on the size of the files you can upload to the server. This improves safety and performance. For reference, LucusHost is limited in size to 128 Mb.
This way, when you try to upload a file that exceeds that size (a PluginPlugin Plugin that is added to the WordPress installation to give it more functions. There is an official repository with thousands of plug-ins available for installation. a theme, a multimedia file...), the system will show you an error informing you that it exceeds the maximum upload size for this site.
How to increase the maximum size allowed?
As it is not a WordPress error itself, the solution to the error can not be found in WordPress either, but we will have to do so from the hosting itself.
Here are some methods you can use to increase the maximum limit for files you upload to WordPress:
Option 1. Change the PHP selector
The fastest option would be to access from CPanel to the "PHP selector" icon and there, in addition to choosing the most updated version of PHP, you must click on the text "Swich to PHP Options".
When you click on this option, a new screen will appear, with the summary of limits that are configured in your server.
To update the maximum size of the files to be uploaded, you must go to the last option "upload max file size" and click on it. A drop-down menu will open where you can choose the new size.
Don't forget to save the changes you have made by clicking on the "Save" button that will appear at the bottom of the screen.
Option 2. Modify the php.ini file
If the first option is not available or if your WordPress hosting provider does not offer CPanel and, therefore, you do not have the PHP selector, you must follow this process.
- Accede a los archivos de tu hosting por medio del FTPFTP Protocolo de internet utilizado para transferir archivos a de un ordenador a otro o, en el caso de WordPress, de un ordenador a un servidor. o del Administrador de archivos de tu Panel de Control.
- Locates the file called php.ini (Beware because sometimes the file manager does not show certain files and hides them).
- Edit the file and find a line where you have this text:
upload_max_filesize = 12M
Here all you have to do is change "12M" to the new limit you want to set and save the file changes.
Option 3. Modify the .htaccess file
In case you can't use either of the two previous options, you should try this new method, following these steps:
- Access your hosting via your FTP account or the Panel File Manager provided to you.
- Locate the file called .htaccess (Be careful because it may be hidden and not appear).
- Edit the file and search for a line like the next one:
php_value upload_max_filesize 12M
As in the previous case, you must replace the number 12 with the new size you choose.
If this line is not in your .htaccess file, you can copy and paste it directly into the file.
Sometimes our hosting provider, for various reasons, has limited the maximum size of files we can upload, so if we try to upload one that exceeds this limit, we will get an error on the screen.
There are different methods to solve the error "exceeds the maximum upload size for this site", but they all consist basically of modifying some parameters in the server where you have contracted the hosting: through the PHP selector, modifying the php.ini file or the .htaccess file.
Have you ever encountered this error? How did you fix it? Leave your comment and share the experience with other users.
Implementador y Formador especializado en WordPress,
Coorganizador del grupo de Meetup WordPress Madrid.
Colaborador en el equipo de traducción de WordPress España.
Podcaster, YouTuber y fundador del blog WPnovatos.com