You try to load an audio file to your WordPress website and ugggh, “… file exceeds the maximum upload size for this site.” Hmmm. Your host server has a php setting that is limiting file upload size, probably in an attempt to save space and bandwidth…. but your client wants an audio clip added to the home page… now.
There are instructional posts around the internet with solutions, but I have found that they can be confusing and sometimes leave out vital bits of information. I want to show you the SIMPLEST way to increase your maximum upload limit for your WordPress website. It’s true, this won’t work on every single server configuration, but I have found it to work about 90% of the time. I’ll go step by step… in detail.
Edit the .htaccess file
Yes, this requires you to have ftp access… but the only method that does not is the functions.php method. That method implies you have a child theme. If you have a child theme, you probably have ftp access. But the main downside to the functions.php method is that I’ve never had it work… so forget it.
- Get ftp access… or use the file manager included in your hosting panel.
- Log into the site by ftp…. or by using the file manager from your host’s cPanel.
- If logging in by ftp, you will use an ftp client on your computer. Some good ones are Cyberduck (my favorite) or Filezilla, both are free and quick downloads.
- Open a connection once inside the ftp client application. Fill in the necessary fields, which will look something like this:
- hostname: ftp.yoursite.com
- user: yourusername
- password: yourpassword
- If your creds are correct, you will soon be looking at your files on the server, yay!
- Once in by ftp, or by your host’s file manager app, make sure you are in the root folder for your WordPress install. You will be seeing files with names like wp-admin, wp-content, etc.
- Look for the file called .htaccess
- If you do not see it, it is probably “hidden.” You will need to go up to File/View Hidden Files if in by ftp client… or the equivalent action in your host’s file manager. Check that option and you will be able to see it.
- Click it to open it…. or click “Edit File” in your file manager.
- The file should open in a text editor… like Notepad or gedit, etc.
- Save a version of it with another name onto your local computer… in case you mess up and need to revert to it. Maybe call it .htaccess_copy.
- You are going to add the lines of code below to tell the server to allow larger file uploads. Copy them to your clipboard (fancy name for your computer’s temporary storage)
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
- Where do you add them? This is the step that most of the tutorials neglect to mention. Put them directly BEFORE the line that reads: </IfModule> You may have a very simple .htaccess file, or you may have a very confusing-looking one with lots of lines… usually added by a caching plugin like WP Supercache. Just look for the “</IfModule>” line, and add the lines right before this.
- Save the file. It will automatically upload over the old one on the server. Be careful.
- Go refresh the page on your website where you were trying to upload the large file.
- Hopefully, your limit will have been raised and you will be golden.
- Congratulate yourself on being a WordPress expert.
If you mess up…
Yes, it’s possible you could take down the site… but that’s okay. You have a copy, remember? Don’t panic.
- Go back to the local copy you saved and named .htaccess_copy
- Copy it and paste it to the server.
- Rename the one currently called .htaccess on the server to .htaccess_hold
- Then rename that one you named .htaccess_copy to .htaccess. It will take over for you.
- Start the process again, and don’t mess up this time
- If you were extra naughty and did not save a local copy, you can find the basic version here. Copy this into the messed up one. That will work.
I hope this helps.
If not, here’s some more solutions…. or just call your host.