Unlimited Storage, Unmetered Bandwidth, Unlimited Sub-domains, Unlimited Emails, Unlimited SQL Dbs FREE DOMAIN & SSL N20,000 Only! ORDER NOW!
28Apr, 2017
0Comments

My IP gets blocked when editing post in WordPress

Have you been getting your IP blocked when editing post in WordPress editor? This is caused by mod_security . IPs are blocked by mod_security automatically and put it in the firewall denied access list which has caused headaches for most developer

To quickly fix it, most people have to restart their modem or contact HostNowNow to delete the blocked IP manually.

After several research by our server admins, we found out this may caused by the WordPress “autosave” and post revision features. When editing a post, WordPress will keep autosave the “draft” or “post revision” during the defined interval, and too often will TRIGGER the mod_security rules easily.

Here is the solution :

Disable Post Revisions

Disable WordPress post revisions feature, or increase its autosave interval. Edit wp-config.php, add following code:

define('AUTOSAVE_INTERVAL', 300 ); // seconds, 5 mins
define('WP_POST_REVISIONS', false );

Here’s a full sample of wp-config.php

wp-config.php
<?php
/** Enable W3 Total Cache */
define('WP_CACHE', true); // Added by W3 Total Cache

define('AUTOSAVE_INTERVAL', 300 ); // seconds, 5 mins
define('WP_POST_REVISIONS', false );

// ** MySQL settings **  //Added by WP-Cache Manager
define('DB_NAME', 'removed-for-security');    // The name of the database
define('DB_USER', 'removed-for-security');     // Your MySQL username
define('DB_PASSWORD', 'removed-for-security'); // ...and password
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

define('AUTH_KEY', 'removed-for-security'); 
define('SECURE_AUTH_KEY', 'removed-for-security');
define('LOGGED_IN_KEY', 'removed-for-security');
define('NONCE_KEY', 'removed-for-security');

$table_prefix  = 'abc_'; 

define ('WPLANG', '');

@ini_set('log_errors','On'); 
@ini_set('display_errors','Off');
@ini_set('error_log','/home/username/www/php-errors.log');

/* That's all, stop editing! Happy blogging. */
if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');
	
require_once(ABSPATH . 'wp-settings.php');
?>


GET OFF THE HOSTING LIMITS! Go unlimited on diskspace, bandwidth, and more. Visit https://www.hostnownow.com/limitless to get started.

Take your site to the CLOUDS! Try out our Cloud Hosting service; own your server. Visit https://hostnownow.com/cloud-hosting/ to get started.

Post A Comment

Your email address will not be published. Required fields are marked *