Created
July 12, 2020 05:16
-
-
Save felds/f69152d385f09d7571977f860da3d7ca to your computer and use it in GitHub Desktop.
Common settings for wp-config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* common settings for wp-config | |
*/ | |
// dont try to connect via ftp for updates | |
define( 'FS_METHOD', 'direct' ); | |
// force urls | |
define( 'WP_HOME', 'https://...' ); | |
define( 'WP_SITEURL', 'https://...' ); | |
// allow all updates | |
// @see https://wordpress.org/support/article/configuring-automatic-background-updates/#constant-to-configure-core-updates | |
define( 'WP_AUTO_UPDATE_CORE', true ); | |
add_filter( 'auto_update_plugin', '__return_true' ); | |
add_filter( 'auto_update_theme', '__return_true' ); | |
// disable pingbacks | |
// @see https://marketingwithvladimir.com/3-methods-disable-xmlrpc-pingback-wordpress/ | |
add_filter( 'xmlrpc_methods', function( $methods ) { | |
unset( $methods['pingback.ping'] ); | |
return $methods; | |
} ); | |
add_filter( 'wp_headers', function ( $headers ) { | |
unset( $headers['X-Pingback'] ); | |
return $headers; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment