mikemansell Posted December 22, 2010 Report Share Posted December 22, 2010 I'm trying to use as few resources as possible on my WordPress installation. Is there anything I can do to disable post revisions? These seem to take up a bit of space and are not really necessary for what I need. Do you have any other tips for making WordPress a more efficient platform? Quote Link to post Share on other sites
Falcon1986 Posted January 4, 2011 Report Share Posted January 4, 2011 (edited) In your wp-config.php file, add the following after define ('WPLANG', '');:/** Stop post revisions and extend autosave interval. */define('AUTOSAVE_INTERVAL', 900); // delay autosavedefine('WP_POST_REVISIONS', false); // turn of post revisionsSome other wp-config.php edits that might speed things up a bit:/** Blog address and site address */define('WP_HOME', 'http://www.yourdomain.com'); // no trailing slashdefine('WP_SITEURL', 'http://www.yourdomain.com'); // no trailing slash/** Template path and stylesheet path specification */define('TEMPLATEPATH', '/home/user/public_html/mysite/wp-content/themes/mytheme');define('STYLESHEETPATH', '/home/user/public_html/mysite/wp-content/themes/mytheme');/** Automated trash emptying */define('EMPTY_TRASH_DAYS', 7); // empty weeklyNote that the second definition will disable active theme switching within the Administrator's dashboard. Comment out when you need to switch themes; revert when done.These are theme-specific tweaks that must be added to your theme's functions.php file. They are not all performance-enhancing tweaks. The comments should give you a general idea, however.// Disable RSS feedsfunction disable_our_feeds() { wp_die( __('<strong>ERROR:</strong> We are sorry, but RSS feeds have been disabled on this website for privacy purposes. Please click <a href="http://www.monambbs2014.com/" >this link</a> to return to the homepage.') );}add_action('do_feed', 'disable_our_feeds', 1);add_action('do_feed_rdf', 'disable_our_feeds', 1);add_action('do_feed_rss', 'disable_our_feeds', 1);add_action('do_feed_rss2', 'disable_our_feeds', 1);add_action('do_feed_atom', 'disable_our_feeds', 1);// Custom Dashboard logoadd_action('admin_head', 'my_custom_logo');function my_custom_logo() { echo ' <style type="text/css"> #header-logo { background-image: url('.get_bloginfo('template_directory').'/path/to/image.jpg) !important; } </style> ';}// Specify favicon for Dashboardfunction favicon4admin() { echo '<link rel="Shortcut Icon" type="image/x-icon" href="http://www.yourdomain.tld/favicon.ico" />';}add_action( 'admin_head', 'favicon4admin' );// Remove WordPress version from headeradd_filter( 'the_generator', create_function('$a', "return null;") );// De-clutter wp_head// Really Simple Discoveryremove_action('wp_head', 'rsd_link');// Windows Live Writerremove_action('wp_head', 'wlwmanifest_link');// BbLD header adremove_action('wp_head', 'bbld');// Post and comment feed linksremove_action( 'wp_head', 'feed_links', 2 );// Category feed linksremove_action( 'wp_head', 'feed_links_extra', 3 );// Index linkremove_action( 'wp_head', 'index_rel_link');// Start, previous and current linksremove_action( 'wp_head', 'parent_post_rel_link');remove_action( 'wp_head', 'start_post_rel_link');remove_action( 'wp_head', 'adjacent_posts_rel_link');// Add canonical links for commentsfunction canonical_for_comments() { global $cpage, $post; if ( $cpage > 1 ) : echo "\n"; echo "<link rel='canonical' href='"; echo get_permalink( $post->ID ); echo "' />\n"; endif;}add_action( 'wp_head', 'canonical_for_comments' );// Disable WordPress autosavefunction disableAutoSave(){ wp_deregister_script('autosave');}add_action( 'wp_print_scripts', 'disableAutoSave' );// Specify use of single custom gravatarif ( !function_exists('fb_addgravatar') ) {function fb_addgravatar( $avatar_defaults ) {$myavatar = get_bloginfo('template_directory').'/path/to/gravatar.png';$avatar_defaults[$myavatar] = 'Caduceus';return $avatar_defaults;}add_filter( 'avatar_defaults', 'fb_addgravatar' ); } Edited January 19, 2011 by Falcon1986 Quote Link to post Share on other sites
Alexander Posted January 19, 2018 Report Share Posted January 19, 2018 Open wp-config.php in and paste this code //disable WP Post Revisions define('AUTOSAVE_INTERVAL', 300); // seconds define('WP_POST_REVISIONS', false); Insert this code above ‘ABSPATH’ You can see this as reference https://www.wpblog.com/disable-limit-wordpress-post-revisions/ Quote Link to post Share on other sites
flashh4 Posted January 19, 2018 Report Share Posted January 19, 2018 You do realize this post is 10 yrs. old ???? Chuck Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.