Skip to content

Instantly share code, notes, and snippets.

@wpbullet
Created April 23, 2018 02:30
Show Gist options
  • Save wpbullet/240b8f7bedf722f82c08fbf498f2a87a to your computer and use it in GitHub Desktop.
Save wpbullet/240b8f7bedf722f82c08fbf498f2a87a to your computer and use it in GitHub Desktop.
Clean WPEngine config and mu-plugins
# Clean WPEngine variables for use with local clone setups
# Author: Mike from https.//wp-bullet.com
# run this in the root folder where wp-config.php lives
# define wp-config.php path
WPCONFIGPATH="wp-config.php"
# clean up WPE variables from wp-config.php
sed -i '/wpe/d' ${WPCONFIGPATH}
sed -i '/WPE/d' ${WPCONFIGPATH}
sed -i '/PWP/d' ${WPCONFIGPATH}
sed -i '/memcached_servers/d' ${WPCONFIGPATH}
sed -i '/WP Engine/d' ${WPCONFIGPATH}
sed -i "/define( 'WP_CACHE'/d" ${WPCONFIGPATH}
sed -i "/define( 'DISABLE_WP_CRON'/d" ${WPCONFIGPATH}
sed -i "/define( 'FORCE_SSL_LOGIN'/d" ${WPCONFIGPATH}
sed -i "/define( 'WP_TURN_OFF_ADMIN_BAR'/d" ${WPCONFIGPATH}
sed -i "/define( 'WP_AUTO_UPDATE_CORE'/d" ${WPCONFIGPATH}
sed -i "/define( 'DISALLOW_FILE_MODS'/d" ${WPCONFIGPATH}
sed -i "/define( 'DISALLOW_FILE_EDIT'/d" ${WPCONFIGPATH}
sed -i "/define( 'WP_POST_REVISIONS'/d" ${WPCONFIGPATH}
sed -i "/umask(0002)/d" ${WPCONFIGPATH}
# remove the empty blank lines https://stackoverflow.com/questions/4521162/can-i-use-the-sed-command-to-replace-multiple-empty-line-with-one-empty-line
sed -i '/^$/N;/^\n$/D' ${WPCONFIGPATH}
# remove the mu-plugins
rm -rf wp-content/mu-plugins/mu-plugin.php
rm -rf wp-content/mu-plugins/wpengine-common
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment