Here's what i would do to increase wordpress security.
Buy your theme/plugin instead of download it illegally. Use strong password for your personal email account, database, hosting account.
Wordpress Setup
1. unique password - changed weekly
2. change table prefix wp_
Create new user
change admin username with strong password
UPDATE wp_users SET user_login = 'newusername' WHERE user_login = 'admin';
change default admin id to xxxx
Disable user registration if not needed
Settings -> General and make sure the “Anyone can register” box is unchecked.
Delete readme.html and install.php
Add blank index.php files where needed
wp-includes
wp-content
wp-content/plugins
wp-content/themes
wp-content/uploads
.htacess on website root folder
1. hide htacess and wp-config
<files wp-config.php>
order allow,deny
deny from all
</files>
<Files .htaccess>
order allow,deny
deny from all
</Files>
2. Protect /wp-includes/
# Block the include-only files
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>
3. To prevent people from browsing the content of your directories
Options All -Indexes
4. protect the .htaccess file itself
<Files .htaccess>
order allow,deny
deny from all
</Files>
create .htacess on /wp-admin/
1. create a separate .htaccess file and upload it to the /wp-admin/ directory
order deny,allow
allow from 192.168.5.1
deny from all
2. for /wp-login/
<Files wp-login.php>
order deny,allow
Deny from all
# allow access from my IP address
allow from 192.168.5.1
</Files>
3. protect the .htaccess file itself
<Files .htaccess>
order allow,deny
deny from all
</Files>
create .htacess on /wp-content/
1. protect wp-content but allow XML, CSS, Javascript, and images, to be processed
order deny,allow
deny from all
<files ~ ".(xml|css|jpe?g|png|gif|js)$">
allow from all
2. disabling PHP file execution in /wp-content/uploads/
<Files *.php>
deny from all
</Files>
*note: Be aware that this code has been known to break some WordPress themes as it does not allow PHP to be executed; particularly themes that use timthumb.php.
3. protect the .htaccess file itself
<Files .htaccess>
order allow,deny
deny from all
</Files>
wp-config setup
1. add salt to wp-config
https://api.wordpress.org/secret-key/1.1/salt/
2. # Enable all core updates, including minor and major:
define( 'WP_AUTO_UPDATE_CORE', true );
3. Disable file editing
define('DISALLOW_FILE_EDIT', true);
4. Turn Off PHP Error Reporting
error_reporting(0);
@ini_set(‘display_errors’, 0);
Using Correct File Permissions
1. All directories should be 755
2. All files should be 644
3. wp-config.php should be 400
4. .htacess should be 400
Remove the WordPress Version Number
You can do this by adding the following code to the top of your theme functions.php file:
remove_action('wp_head', 'wp_generator');
Limit login attempt
http://wordpress.org/plugins/login-lockdown/
Disable XML-RPC
http://wordpress.org/plugins/disable-xml-rpc-pingback/
two-step authentication
http://wordpress.org/plugins/google-authenticator/
add captcha:
https://wordpress.org/plugins/google-captcha/
back up plugin:
https://wordpress.org/plugins/updraftplus/
Use cloudflare
https://www.cloudflare.com/