CodeHQ

Posts Tagged ‘WP’

|

Limit WordPress Revisions

Tuesday, January 9th, 2018

Add this to you wp-config.php file and change the number for how many revisions you want to limit your pages to:

define('WP_POST_REVISIONS', 10);

Or use the below to globally turn off post revisions:

define('WP_POST_REVISIONS', false);

Tags: , , , , , , , , ,
Posted in PHP, WordPress | No Comments »

Hiding WP-Login page | WordPress

Saturday, May 21st, 2016

Using the below code in your functions.php file, you would then only be able to access the WP dashboard by navigating to domain.com/wp-login.php?admin=access.

// Hiding wp-admin and wp-login.php 

function protection_for_login_page() {
$QS = '?admin=access';
$theRequest = 'http://' . $_SERVER['SERVER_NAME'] . '/' . 'wp-login.php' . '?'. $_SERVER['QUERY_STRING'];

	if ( site_url('/wp-login.php').$QS == $theRequest ) {
		echo 'Query string matches';
	} else {
		header( 'Location: http://' . $_SERVER['SERVER_NAME'] . '/' );
	}
}
add_action('login_head', 'protection_for_login_page');

Tags: , , , , , ,
Posted in PHP, WordPress | No Comments »