Identify the limit preventing your upload
You add an image, document, or archive, and WordPress reports that the file exceeds the allowed size. Before changing the server, record the exact message and where it appears. A refusal in the Media Library, an error while installing a theme, and an HTTP 413 page can have things in common, but they do not always need the same fix.
Under Media, then Add New Media File, check the maximum size shown below the upload area. Compare it with the size in the file properties on your computer. Pay attention to the units: a few thousand kilobytes are not the same as a few thousand megabytes. Leave some headroom, too, because a request includes additional information around the file.
Then try a small, valid file of the same type. If it uploads and the larger one fails, you have a useful clue to compare with the remaining storage as well. If both are rejected with a message about the format, permissions, or temporary directory, size is probably not the only issue. Raising a size limit does not authorize a file format or fix a full disk.
This guide mainly covers WordPress installations whose hosting you can manage. On WordPress.com or a fully managed plan, the limits and available access depend on the service. Start with your account information and plan documentation; you may not have a PHP configuration file you can edit.
Distinguish the per-file cap from your plan quota
A 20 MB file may fit within a 64 MB cap and still be impossible to save if only 5 MB remains in the account. The per-file cap applies to an individual upload; the storage quota concerns the total space already occupied. Media and, depending on the contract, other account items share this capacity. A successful small-file upload therefore does not rule out a nearly exhausted quota.
Some hosts also impose a maximum number of files and directories, often called an inode limit. This count differs from the gigabytes used: a large number of small files can reach the limit while storage space remains. Reducing a file’s size does not reduce the number of files already present. Ask the provider exactly what the count covers rather than inferring capacity from the storage gauge alone.
On self-hosted WordPress, check resource usage in the hosting control panel: space used, space allocated, and the file quota where one exists. In cPanel, Disk Usage helps locate consumption if the provider offers it. If you only have WordPress access, ask the account manager for these figures; being a site administrator does not automatically give you access to hosting limits.
On WordPress.com, open the hosting dashboard, select the site, and check the plan and storage usage in its overview. Capacity depends on the plan that applies to that site. An expired or canceled paid plan may also restrict new uploads while previously published media remains accessible. A PHP value or plugin cannot create the missing space within this platform quota.
If a quota has been reached, first establish what is counted and which remedies the plan allows. Any cleanup requires an inventory and a backup outside the full account: do not bulk-delete media or its variants. The following three approaches address an oversized file; they do not replace resolving an exhausted overall quota.
Choose one of the three approaches
A photo measuring several dozen megabytes and intended as a small illustration often deserves preparation before uploading. Conversely, a downloadable document may need to retain its resolution and content. Choose the method according to its use, without confusing the need to publish a file with the need to keep its original version everywhere.
The first approach reduces the file size to what is useful. It suits oversized images, unnecessarily large scanned documents, and media that can be exported again. The second adjusts the configuration actually applied by the host. It suits a reasonable file that needs to be accepted regularly. The third uses a server-side import or a suitable delivery solution for a particular need.
Prepare a rollback before changing any configuration. Record the previous values and keep a private copy of the affected files. If several sites share the account, check the domain selected in the panel. Changing a global limit may affect installations outside your test.
Do not delete the original to save space during diagnosis. Work on a clearly named copy and keep both versions until the published result is satisfactory.
Approach 1: prepare a smaller image
Open a copy of the image in a local editor. Check its pixel dimensions and compare them with the intended use. An illustration displayed in a text column has different needs from a photograph offered as a download for printing. Reduce the dimensions to a suitable display size, then export a new version.
Then adjust compression while inspecting the result, especially small text, edges, and areas of uniform color. Do not simply choose the smallest file: a blurry image can make a guide or product harder to understand. Also check transparency and colors if you change the format.
Simply renaming a file extension does not convert an image. A file with a new ending may still be encoded in its original format. Use the editor’s export function and select a type your installation accepts. For confidential documents, prefer local processing to uploading to a compression service whose terms you do not know.
Try the smaller copy in the Media Library. Once imported, open its details and preview it on a test page. Check that it has the expected dimensions and remains comfortable to view on an ordinary screen. Variants generated after import cannot retroactively get an original through a rejection that happened before it reached WordPress.
Prepare a PDF or choose where to deliver a video
For a PDF, first identify what makes it large: full-resolution photographs, scanned pages, or unused resources. Export a copy optimized for its use from the original software. Then check the pages, links, text search, and any form fields. A successful reduction preserves what the reader needs.
If the document must remain downloadable at its original quality, do not degrade it simply to fit an arbitrary limit. Move on to a configuration adjustment or an appropriate file-hosting solution. Also consider available storage and backups: a large file will be stored, copied, and downloaded repeatedly over its lifetime.
A long video can be delivered by a service designed for that purpose and embedded in the page. Check privacy terms, distribution rights, and the visitor experience. An external service involves a different storage arrangement and sometimes a cost; it is not an automatic fix for all media.
Avoid shrinking a plugin or theme archive by randomly removing files. An installation archive must retain its structure and components. For this case, use the procedure provided by its publisher and your host.
Approach 2: understand the two main PHP values
The upload_max_filesize directive sets the maximum size of an individual file received by PHP. post_max_size limits all data in a POST request. The latter must leave enough room for the file and its accompanying information. For an example file smaller than 64 MB, values of 64M and 80M can be consistent, provided the host allows them.
WordPress calculates its limit from these values, then may apply its own filters or restrictions. The Media Library figure therefore does not necessarily describe every limit in front of the site. An intermediary server can reject an upload before PHP even receives it.
Go to Tools, Site Health, then Info. The Server and Media Handling sections provide information about the environment and limits. Record the visible values before changing them. They are more relevant to the website than a result obtained with another PHP version in a terminal.
Available memory and processing time are other settings. They may become important after receipt, particularly when generating variants of a large image. However, increasing WordPress memory alone does not change the permitted incoming file size. Address the limit demonstrated by the message you received.
Change the values in your host’s control panel
In the hosting account, open PHP management for the relevant domain. Screen names vary: PHP options, PHP configuration, or INI editor, for example. In cPanel, MultiPHP INI Editor lets you select a location and set the available directives when the provider has enabled it.
Select the correct domain, record the current values, then set both limits according to the size needed. Use the units the interface expects. Some fields require a value with the letter M; others offer a list. Do not copy the presentation in a screenshot from another panel if your interface expects a different format.
Apply the change and check Site Health and the Media Library again. If the hosting interface reports a new value but WordPress still displays the old one, do not repeat the change in several places. Check the domain, PHP version, and time needed for the change to take effect, then ask support which configuration is actually loaded.
If the tool is unavailable or a value is capped, tell the provider the file size, type, and intended use. Ask for a targeted adjustment for this site. The provider can confirm whether a plan, server, or proxy limit also needs changing.
Use a configuration file when the provider supports it
If your host documents the use of .user.ini, you can set the permitted directives there. This method applies to compatible CGI or FastCGI environments; it is not universal. Have the correct directory confirmed and back up the existing file before editing it. Keep other settings and avoid conflicting definitions.
The example below illustrates only the two limits. It does not promise that a host will accept these values. Do not add PHP tags to an INI file. After saving, allow the reread mechanism to run: its interval is configurable and commonly defaults to five minutes.
If the control panel already manages these values, use that panel. An extra file may complicate diagnosis without changing the effective limits. An installation using PHP as an Apache module may support other mechanisms. Do not insert php_value directives into .htaccess without checking support: an incompatible configuration can cause a 500 error.
upload_max_filesize = 64M
post_max_size = 80MWhy some code snippets change nothing
You may find suggestions to add ini_set() to the theme or to wp-config.php. The size directives concerned cannot be freely changed while a script is running. The upload may already have been rejected by the time WordPress starts processing it. Moving the same snippet between files does not give it additional permissions.
Likewise, changing only the number displayed in the Media Library does not force PHP or the server to accept the file. It can make the form misleading: the user selects a file described as acceptable, then receives a rejection further along the path.
Do not install a plugin solely because it promises unlimited size. Understand which setting it can actually change and which limits the provider still imposes. A documented configuration checked in Site Health and validated with an actual upload provides more useful evidence than a number displayed on another screen.
Also avoid unlimited values as the default. Choose a size proportionate to the need and available resources. A reasonable limit helps control accidental uploads and storage consumption.
Check multisite network restrictions
On WordPress multisite, the network administrator can set a maximum file size and a storage quota per site. An administrator limited to one site may not have these settings. Ask the person responsible for the network to intervene if you cannot see the relevant options.
In Network Admin, inspect Settings and the upload settings. Compare the per-file limit with the PHP limits, taking account of the displayed units. Check total remaining space separately. Increasing the permitted size of a file does not create extra space when the site quota is exhausted.
When network space checking is enabled, WordPress can also reduce the advertised maximum according to the remaining quota. If the displayed figure falls without a PHP change, check the site’s remaining space. This mechanism avoids advertising capacity that the quota no longer lets you use.
Keep a value appropriate for the network and verify the result on the affected site. Settings may have a scope wider than this one site. Do not change allowed file types if the problem concerns only their size.
A multisite network therefore adds a level of control; it does not replace the server’s controls. If a higher value is defined at network level but PHP retains a lower cap, the file remains subject to that lower limit.
If a 413 error appears despite the new settings
A 413 page indicates that a component rejects the request size. If Site Health shows the new values correctly, examine the web server and services in front of it. On Nginx, client_max_body_size is one relevant directive. On managed hosting, ask for its application to the affected route and domain to be checked.
Give support the test time, upload page address, file size, and full message. Ask at which layer the rejection occurs. Increasing PHP limits does not automatically change a proxy or security-service limit.
Do not disable the entire firewall or proxy to upload a single file. A targeted adjustment or an import method supported by the provider may meet the need without changing the site’s overall operation. If the plan imposes a fixed limit, choose a compatible size or another authorized route.
If transfer finishes but image generation then fails, keep that new message. You may have passed the upload limit and encountered a different processing problem. Reducing dimensions may then be more appropriate than increasing the upload cap again.
Approach 3: import media from the server with WP-CLI
For a one-off need, SFTP and WP-CLI access may let you transfer media to the server and then register it in the Media Library. This method requires authorized access, a file intended to be public, and sufficient storage space. It is not a way to bypass hosting quotas or terms.
First place the file in a private temporary directory whose exact path you know. In an SSH session, move to the correct WordPress installation and confirm its domain before importing. The command below uses an example path to replace; it creates an attachment and may trigger media processing.
Importing a file this way avoids the HTTP upload form, but does not guarantee that its format, size, or processing will be accepted. Run a controlled test and read the result. Simply placing a file in the images directory using SFTP does not automatically create its corresponding Media Library entry.
wp media import "/chemin/prive/document.pdf" --title="Document à télécharger"Verify the import and tidy up the configuration
Open the media details and check its name, size, preview, and download. Add it to a draft to verify the result in the page’s actual context. For an image, inspect the variants used; for a document, open several pages and important links.
After a command-line import, also check file ownership and permissions if the host recommends it. A command run under an unsuitable account may leave files that the web process cannot manage correctly. Remove the temporary copy only after confirming the import, while retaining your local original.
If you raised a limit for an exceptional operation, decide whether it is still necessary. Restore the previous values where appropriate and record the final setting. You should be able to explain where the limit is defined and how to reproduce a normal upload.
The expected result is straightforward: the useful file reaches the Media Library, remains readable, and displays correctly, with a consistent configuration. Keeping this full verification avoids treating a changed number as a repair in itself.
Prepare a JPEG copy with GIMP, without an upload service
GIMP is a free editor you can use locally to prepare a photo before uploading it. This procedure applies to a still image intended for display; it is not suitable for a PDF that must be preserved or an animation whose successive frames must be retained.
If the photo needs transparency, use an appropriate format instead of JPEG. This processing reduces the file you upload; a plugin that optimizes media after receipt cannot retroactively unblock a file rejected before arrival.
- Open a copy of the photo, then choose Image → Scale Image. Select pixels and keep width and height linked to preserve the proportions.
- Enter a width appropriate for the intended placement, then apply it. Changing only the print resolution in dots per inch does not reduce the photo’s pixel count.
- Use File → Export As and give it a new name ending in
.jpg. Choose the quality by examining the preview; do not replace the original. - Open the exported file from your folder, check its size, orientation, and detail legibility, then upload this copy.
Sources and references
Use these references to check the features, requirements and limitations described. Reading documentation is not a practical test.
View 19 references
- PHP: file and request limits ↗
- PHP: per-directory configuration ↗
- PHP: directive change modes ↗
- WordPress: calculating the upload limit ↗
- WordPress: PHP resources ↗
- WordPress: multisite network settings ↗
- WordPress: Site Health ↗
- WordPress: image size and quality ↗
- WP-CLI: importing media ↗
- Nginx: request body size limit ↗
- cPanel: PHP configuration editor ↗
- WordPress: Apache and local configuration ↗
- WordPress.com: accepted files and limits ↗
- WordPress.com: checking available storage and plan capacity ↗
- cPanel: disk usage and quota overruns ↗
- Hostinger: file and directory quota, separate from disk space ↗
- WordPress multisite: upload cap and remaining space ↗
- GIMP: resizing an image for the screen ↗
- GIMP: exporting images ↗


