Home / Questions / Why can’t I upload a file larger than 2 MB in WordPress?

Why can’t I upload a file larger than 2 MB in WordPress?

The upload limit comes from PHP settings on your server. Raise upload_max_filesize and post_max_size, or compress the file before you upload it.

WordPress shows the limit it reads from the server. The real cap comes from two PHP settings, upload_max_filesize and post_max_size. Your host sets them, and many shared plans start low.

Ways to raise the limit

  1. Open your hosting panel, find the PHP settings, and raise both values. The post size must be equal to or larger than the file size.
  2. Add these lines to wp-config.php, but only if your host allows it: @ini_set( 'upload_max_filesize', '64M' ); and @ini_set( 'post_max_size', '64M' );.
  3. Upload a .user.ini or php.ini file in the main folder, if the host supports that.

Ready to act on this?

Get a written review of your site, or send us your question and we will reply within 24 hours.

Smaller files are often the better fix

A large photo or PDF slows the site for every visitor. Compress images to WebP before upload, and split long videos. Video should be hosted on YouTube or Vimeo, not in the media library.

If you cannot change the PHP settings, contact us and we will look at the setup for you.

Related services

Not sure where your site stands?

Send us the details and we will reply within 24 hours with a clear next step.