WordPress is an excellent platform to build a website in a few hours. However, there are multiple issues that you can face as a beginner. These issues can irritate you and will test your patience. One such issue is how to increase WordPress Memory limit. It usually happens when you have just created a website.
It is not entirely your fault when you are installing WordPress. It happens from the server-side. Most hosting services have uploading and memory limits. If you are a victim of such a thing, then there are easy and small steps to take care of such an issue.
Moreover, when you are correcting these issues, you will learn a new thing and your knowledge about WordPress and PHP will also increase. Here, we have created a simple guide to increase WordPress memory limit when creating a website.
Increase WordPress Memory Limit
WordPress memory limit is an issue that usually comes from a script written in the php files. You can resolve it by making very small adjustment in those files.
We will be telling you which files to edit when you are trying to increase WordPress memory limit or uploading limit.
If you are facing this error, then you won’t be able to upload a file that exceeds the specified size in those files. It means if you are adding a specific file which is larger in size than the standard written in those code files, then you won’t be able to upload it. Let’s have a look at different files that you need to edit to resolve this issue.
Editing wp-config.php file
The first file that you need to locate is named, ‘wp-config.php’. To locate this file, you need to access core files of your WordPress.
To do so, you can log in to your cPanel account where you will be able to locate the WordPress installation folder. After logging into cPanel, you will have to click ‘File Manager’ Option. After accessing File Manager, you will be able to see the complete directory of your website. Here, you will click a folder named, ‘Public_HTML’.
After accessing that folder, you will be able to find a file ‘wp-config.php’. Open that file and click edit. Now you can locate the line where it says:
Define ( ‘WP_MEMORY_LIMIT’, ‘64M’ ) ;
Now you can increase the memory limit to your desired value. You can increase it to ‘256M’ as this value works fine when uploading larger files. After making the changes, you need to save the file. You can go to your website and start uploading to see if the issue is resolved. If you are still unable to upload the files and getting the same error, then you can move to the next step and edit php.ini file.
Increase WordPress Memory Limit By Editing PHP.ini file
To access this file, you need access to the main PHP folder on your server. If you don’t have access to this file, then you move on to the next step.
If you have access to this file, then you need to locate the file named, ‘php.ini’ and edit it.
After opening that file, you can search for the terms: ‘Memory_limit’ and ‘max_upload_size’. After finding these files, you will have to increase the value to ‘256M’ and save the file.
After saving the file, you can move on to your website and the issue you are facing will be resolved.
Editing .htaccess file
If you can’t access the php.ini file, then there is an alternative solution for it. You will have to edit the file named ‘.htaccess’. You can find this file in the WordPress directory.
You can edit the file named, ‘.htaccess’ the same way you edited the ‘wp-config.php’ file. You will have to login to cPanel and visit File Manager to access this file. Open the Public_HTML folder and you will be able to see ‘.htaccess’ file.
You will have to edit the file and insert the following line of code at the end:
Php_value memory_limit 256M
This will resolve the issue and you will be able to upload the files easily after increasing WordPress Memory limit.
Contacting your Hosting Service Provider
If you are still facing the issue, then you can contact your hosting service provider and ask them to resolve the issue.
If you have no idea how to get into cPanel, then you should consider using this option as your first option.
Your hosting service provider will take care of the situation and you will be able to upload your files easily.
WordPress is extremely easy to use. However, when you are facing such issues, then it can become irritating for beginners. Whether you need to change font size or want to build a website from scratch, you can find complete guides from us.
Use this handy guide to increase WordPress memory limit and maximum upload file size and stay tuned for lots of free WordPress guides.