Created
May 22, 2022 15:35
-
-
Save warderer/c75eeb24e933ea20dadaaf8900be9c91 to your computer and use it in GitHub Desktop.
[Wordpress Enhanced Security] Small tweaks via functions.php to improve wordpress security. #wordpress #security
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
| # disabling PHP file execution in directories where it’s not needed such as /wp-content/uploads/ | |
| <Files *.php> | |
| deny from all | |
| </Files> | |
| # Disable file indexing | |
| Options -Indexes |
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
| # Disable Login Hints for a Generic Error Message | |
| # Source: https://www.wpbeginner.com/wp-tutorials/11-vital-tips-and-hacks-to-protect-your-wordpress-admin-area/ | |
| function no_wordpress_errors(){ | |
| return 'Something is wrong!'; | |
| } | |
| add_filter( 'login_errors', 'no_wordpress_errors' ); | |
| # Disable the function responsible of showing the WP version in generator and rss | |
| # Source: https://www.wpbeginner.com/wp-tutorials/the-right-way-to-remove-wordpress-version-number/ | |
| function wp_remove_version() { | |
| return ''; | |
| } | |
| add_filter('the_generator', 'wp_remove_version'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment