---
title: "WordPress Upload Limit Still Too Low? Check Both PHP Limits"
description: "Find the WordPress upload limit that rejected your file. See one 2 MB upload fail two different ways, then succeed after the right PHP setting changes."
canonical_url: "https://webaloha.co/wordpress-upload-limit/"
markdown_url: "https://webaloha.co/wordpress-upload-limit.md"
date_published: "2026-12-02T00:00:00.000Z"
date_modified: "2026-12-02T00:00:00.000Z"
author: "https://webaloha.co/authors/lucky-oleg/"
---
[WordPress & PHP guides](https://webaloha.co/wordpress/)

# Why WordPress Still Rejects Your File After You Raise the Upload Limit

Author: [Lucky Oleg](https://webaloha.co/authors/lucky-oleg/) | Published Dec 2, 2026

**When WordPress says “The uploaded file exceeds the upload\_max\_filesize directive in php.ini,” check the PHP settings the site actually uses.** Go to **Tools → Site Health → Info → Media Handling**. The file must fit `upload_max_filesize`, and the *whole form submission* must fit `post_max_size`. If both look high enough, check the response to the failed upload before changing another setting.

 ![A landscape print passes through two yellow measuring frames of different sizes.](https://webaloha.co/_astro/wordpress-upload-limit-cover.CNdUe2Xa_Z1lfCmj.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)

On our test site, the Media screen showed **2 MB** and our file was exactly **2 MiB** (2,097,152 bytes). The upload failed. The form added 355 bytes, which pushed the request past PHP’s limit. WordPress told us the link had expired.

## How one file produced two different WordPress upload errors

We signed in to a disposable [WordPress Playground](https://wordpress.github.io/wordpress-playground/) site and submitted the same plain-text file to the Media Library’s upload endpoint under three configurations. We used WordPress 7.1.5 and PHP 8.3.37, starting with an empty library each time. We sent the form directly so we could observe what the server did even when the browser uploader might have stopped the file first.

| PHP file limit | PHP POST limit | Maximum shown in Media | What happened |
| --- | --- | --- | --- |
| `1M` | `4M` | 1 MB | WordPress returned the `upload_max_filesize` error. The library stayed empty. |
| `3M` | `2M` | 2 MB | The upload returned HTTP 403 and “The link you followed has expired.” The library stayed empty. |
| `3M` | `4M` | 3 MB | WordPress created an attachment. We downloaded it and verified that its size and SHA-256 checksum matched the original. |

The first rejection arrived in a response with **HTTP 200**. The response body reported failure, and PHP had assigned the file [upload error code 1](https://www.php.net/manual/en/features.file-upload.errors.php). If you only check for a red network request in the browser, you can miss this error.

In the second test, the **file** fit under `3M`. The **request** exceeded `2M`. A separate diagnostic request with the same body showed that PHP had discarded both the form fields and the file. That included the security token WordPress expected. The expired-link message was how this upload endpoint handled the missing token. Other forms may describe the same problem differently. [PHP documents what happens when a POST exceeds the limit](https://www.php.net/manual/en/ini.core.php#ini.post-max-size).

![A file of 2,097,152 bytes plus 355 bytes of form data made a 2,097,507-byte request, 355 bytes over the 2 MiB POST limit.](https://webaloha.co/_astro/wordpress-upload-limit-request.3jL-ahil.svg)

The exact body we sent. The extra bytes held the form fields, file details and multipart boundaries. Their size changes with the form.

## Read the limits for the site that failed

Open **Media → Add Media File** and note the maximum under the uploader. Then go to **Tools → Site Health → Info → Media Handling** on that same site. In the English [Site Health screen](https://wordpress.org/documentation/article/site-health-screen/), check that **File uploads** says **Enabled**. The next three rows explain which limit applies.

| Site Health label | What it tells you |
| --- | --- |
| Max size of an uploaded file | The PHP limit on one file, `upload_max_filesize`. |
| Max size of post data allowed | The PHP limit on the whole form submission, `post_max_size`. |
| Max effective file size | The smaller of those two configured values. In our `3M` / `2M` configuration, the full 2 MiB allowance was already used by the file alone. |

For ordinary positive limits, [WordPress takes the smaller PHP value](https://developer.wordpress.org/reference/functions/wp_max_upload_size/) and passes it through the `upload_size_limit` filter. A plugin or a network setting can therefore change what the uploader displays. The calculation cannot tell how large a request your hosting proxy will accept, or exactly how many bytes a particular form will add.

If the hosting panel says `64M` and Site Health still says `8M` for the same directive, resolve that discrepancy first. Check the domain, whether you changed staging or production, and which PHP version serves that domain. A terminal command such as `php --ini` describes the command-line PHP configuration. A host can run the website with a different configuration.

## Increase the PHP limit without guessing at the others

Suppose an editor needs to upload a single PDF up to 32 MiB. On a host that supports these limits, this example leaves room for the rest of the form. Enter the values in the PHP settings for that domain.

```
upload_max_filesize = 32M
post_max_size = 40M
```

Here the 8 MiB difference leaves room for the form. A form that puts two 30 MiB files in one request would still exceed `40M`. Check whether your uploader sends the files separately or together before choosing the values.

Use the PHP settings in the hosting panel if available. Record the previous values, set the finite limits the upload needs, and reload the admin screens to check what PHP now reports. On hosts that support it, a [per-directory `.user.ini` file](https://www.php.net/manual/en/configuration.file.per-user.php) is another option for CGI/FastCGI PHP. The default refresh interval for that file is five minutes. Your host can change or disable that mechanism.

If your host uses Apache with mod\_php, ask whether [PHP settings in `.htaccess`](https://www.php.net/manual/en/configuration.changes.php) are allowed before editing that file. Check PHP’s [configuration modes](https://www.php.net/manual/en/configuration.changes.modes.php) if you are unsure which settings a script can change. A change to `WP_MEMORY_LIMIT` addresses a different problem. If PHP accepted the image and the error log records memory exhaustion while generating thumbnails, follow the [WordPress memory limit guide](https://webaloha.co/wordpress-memory-limit/). If you just need a smaller JPEG or PNG for a page, try a copy in the [image compressor](https://webaloha.co/tools/image-compressor/) and compare the result before replacing the original.

## When Site Health looks right, follow the failed request

**The uploader refuses the file immediately.** Open your browser’s developer tools, select Network, and try once more. If no upload request appears, check the limit and allowed file types shown on that particular form. If the core Media uploader accepts the same file, investigate the form or plugin that refused it.

**A request returns HTTP 413.** Give the host the upload path, the time including time zone, the file size and the HTTP status. Ask which component produced the response. For example, [nginx can return 413 when the body exceeds `client_max_body_size`](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size). [Apache’s `LimitRequestBody`](https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestbody) can also restrict a request, and a proxy in front of either server may have its own limit. Site Health cannot inspect those settings. Our Playground test covered PHP and WordPress only.

**One site in a WordPress Multisite network shows a smaller maximum.** Ask the network administrator to open **Network Admin → Settings → Upload Settings**. There are separate controls for maximum file size in KB, allowed file types, and site storage. With space checking enabled, [WordPress also includes remaining space in its calculation](https://developer.wordpress.org/reference/functions/upload_size_limit_filter/). A site with 6 MiB left cannot take an 8 MiB file even if the network permits 32 MiB per file. Check the [network upload settings](https://developer.wordpress.org/advanced-administration/multisite/admin/settings/#upload-settings) before increasing PHP across the network.

**Even a small file fails.** Retry with a small file of a type the same uploader allows, using a freshly loaded form. A message about a missing temporary directory, a write failure or a forbidden type points to a different check. Preserve the exact wording. Increasing the size limit will leave those problems in place. If the upload triggers a WordPress critical error, [check the failing component](https://webaloha.co/wordpress-critical-error-recovery/) before raising limits.

## What counts as a successful fix?

Repeat the original task using the same file, account and upload screen. For a Media upload, look for the new attachment, then open its file URL. For a form, confirm the submission contains the expected file. In our test, Media showed 2 MB and a 2 MiB file still failed. It took a 2,097,507-byte request to deliver the 2,097,152-byte file.

If a host and a site maintainer share responsibility, one compact message gives both of them something to check. Include the affected upload screen, exact file size, both Site Health values, and the status and wording from the failed attempt. Omit the file itself if it contains private information. If you need help distinguishing a hosting limit from a form or media-processing error, those details are also a useful starting point for [WordPress maintenance support](https://webaloha.co/wordpress-website-maintenance-services/).

## Frequently asked questions

Can I raise upload\_max\_filesize in wp-config.php?

No. PHP classifies upload\_max\_filesize and post\_max\_size as PHP\_INI\_PERDIR settings. An ini\_set() call in wp-config.php leaves them unchanged. Use the host’s PHP panel or the active web php.ini. For a directory override, CGI/FastCGI supports .user.ini if enabled. With Apache running PHP as mod\_php, php\_value in .htaccess works if the host permits that override.

I uploaded a large file from a tab I left open. Did the link expire or was the file too big?

Open a fresh form and submit the same file once. If that succeeds, a stale security token is plausible. If only a smaller file succeeds in a fresh form, check post\_max\_size and the total request size. Either problem can leave WordPress without a valid token.

My form drops the last few photos, even when every photo is small. Which limit should I check?

If the form sends them together, check Max simultaneous file uploads under Media Handling. PHP’s max\_file\_uploads limits how many files a single request can contain. Retry with half the photos. If the form sends one request per photo, that count limit cannot explain a failure on the last photo.

How much headroom should I leave above my largest file?

Size post\_max\_size for the largest complete submission the form accepts. Include every file sent in that request, its fields and multipart formatting. The 355 extra bytes in our plain-text test were specific to that form. A form that includes a long message or several attachments needs more room.

Does the size of a theme or plugin ZIP mean its compressed or extracted size?

For a browser upload, PHP measures the ZIP file you select, before WordPress extracts it. An archive can pass the upload checks and still fail to install. For example, a theme installer that reports a missing stylesheet has reached the package contents. Check whether you selected a download bundle that contains a separate installable ZIP.

Why does a contact form reject my PDF when Media Library accepts it?

Try the same PDF by itself in the form. If it fails before any request appears in the browser’s Network panel, check that field’s permitted file types and size. If the PDF works alone but fails with a second attachment, check the form’s combined limit and whether the two files travel in a single POST.

Useful info? Spread the Aloha:

[![Lucky Oleg](https://webaloha.co/_astro/lucky-oleg.EPOIIvwX_ZX2S03.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)](https://webaloha.co/authors/lucky-oleg/)

[Lucky Oleg](https://webaloha.co/authors/lucky-oleg/)[](https://www.linkedin.com/in/luckyoleg/)

Lucky Oleg is the founder of Web Aloha, a web design & SEO agency helping businesses ride the digital wave. With years of experience in WordPress, technical SEO, and web performance, he writes about what actually works in the real world.

## Related guides from Web Aloha

[![](https://webaloha.co/_astro/guide-wordpress-memory-limit.BW7bJ2IR_1kiYTQ.webp?dpl=dpl_DrmCruovR5ERrm6ZjA2htQ2bJB2W)

Increase WordPress Memory Limit: Find the Limit That Applies

](https://webaloha.co/wordpress-memory-limit/)
