Chuck Daddy Tech Solutions
Contact us to get started with any of our services!

Wordpress Optimization

Pay Per Click (PPC) Management

Conversion Rate Optimization

Email Marketing

Online Presence Analysis

303-946-6159

chuck@thechuckdaddy.com

Denver, CO

303-946-6159

Centennial, CO

Top

Upload Large Files to WordPress by Increasing PHP Memory Limit

PHP Memory Limit

Upload Large Files to WordPress by Increasing PHP Memory Limit

 

Usually when you can’t upload large files to WordPress it is because you need to increase your PHP memory limit. This can very easily be done by adding code to your wp-settings.php file in your WordPress installation.

Simply find this line of code:

// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
wp_initial_constants();

Now, add the code to increase the memory limit above the “wp_initial_constants()” line.

Please note, this setting may not work if your hosting does not allow for increasing the PHP memory limits. In such an event, contact your hosting provider to increase the PHP memory limit. Also, note that many shared hosts set the PHP limit at 8MB, which is really low!

To increase PHP Memory to 64MB, add the following code:

define( 'WP_MEMORY_LIMIT', '64M' );

To increase PHP Memory to 96MB:

define( 'WP_MEMORY_LIMIT', '96M' );

etc…

In the end, your wp-settings.php code should look something like this:

// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
define( 'WP_MEMORY_LIMIT', '256M' );
wp_initial_constants();

Now you can upload large files like videos and audio to your site. Then simply use the very easy Media Library to manipulate your files and add them to posts and pages. Happy coding!

Share