Setting up Automatic Update for All WordPress Plugins

By Zilli,

You can set WordPress to automatically install all plugin updates by simply adding this code to your theme’s functions.php file or a site-specific plugin.

add_filter( 'auto_update_plugin', '__return_true' );

This filter tells WordPress automatic updater to automatically install plugin updates when they’re available.
If you also want to automatically update your themes, then you can add another code like this:

WordPress auto update config

By Zilli,

1. disable FTP commands from config.php
2. add to config.php

// Update core
define( 'WP_AUTO_UPDATE_CORE', true );

optionally for Synology NAS

# reset chown for Synology user nobody
chown -R nobody:nobody /web/wordpress/dir

# reset files and folders chmod in /web/wordpress/dir
find . -type f -exec chmod 0644 {} \;
find . -type d -exec chmod 0755 {} \;

Protects your WordPress against brute force login attacks using .htaccess

By Zilli,

write in .htaccess and change example\.com with your domain:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(.*)?example\.com [NC]
RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteRule ^(.*)$ - [F]

Manually update a new version of wordpress

By Zilli,

1. back up all your wordpress files and databases
2. download the latest version of wordpress
3. deactivate all your plugins: Go to Plugins >Installed plugins
4. Now keep the following files/folders in your web directory:

  • wp-config.php
  • wp-content
  • .htaccess

  Category: OS
  Comments: None