Media Upload size in WordPress

Posted on May 24th, 2011

By default, the maximum file upload size in wordpress is 2MB. So for uploading video files, PDFs, etc, we may need upload it through FTP. This is very difficult for a user with basic computer knowledge. Fortunately we have some codes to tweak the server settings to increase the File upload size.

The steps are as follows.

1.       Create a file named php.ini in the root folder.

2.       Put the below code in it.

?php

/*

Plugin Name: PHP Settings

Plugin URI: http://wpsecurity.net

Description: Attempts to set the max upload size and script timeout settings in the server’s PHP config

Author: Mark – WPSecurity.net

Version: 1.0

Author URI: http://mpsecurity.net

*/

ini_set(‘upload_max_size’,’1000M’);

ini_set(‘post_max_size’,’995M’);

ini_set(‘max_execution_time,’300′);

?>

3.  Add the below code in wp-settings

<?php
/**
 * Used to setup and fix common variables and include
 * the WordPress procedural and class library.
 *
 * You should not have to change this file and allows
 * for some configuration in wp-config.php.
 *
 * @package WordPress
 */
 
if ( !defined('WP_MEMORY_LIMIT') )
        define('WP_MEMORY_LIMIT', '500M');