Archives Recipes

Recipe

Backing Up WordPress Site Over SSH

Paste the following into terminal while connected over SSH. Now run backup <folder-name>/. Make sure to target the folder where WordPress lives like backup public/ or backup htdocs/. This will generate a full backup with a link to download it.

Realtime Monitor Kinsta Access Logs

Create ~ with the following. Then chmod +x ~ to grant execute permissions and ~ to run. This will continiously monitor Kinsta’s access logs and show realtime activity for the top IPs. To exit press Command + C.

Deactivate WordPress

Injects mu-plugin deactivate-wp.php which turns off front end of WordPress. Customize header, description and message variables at the top before running. To re-enable simply remove the mu-plugin.

Fetch database autoload size

Generally a good idea to keep your database autoload below 1MB in size. You can see the current usage with the following. For optimizing, I recommend reviewing Kinsta’s guide:

Fetch PHP memory limit

WordPress’ memory limit can be independently set to anything however will not go over PHP’s own limit. This will retrieve PHP’s memory limit. Will attempt to retrieve from default location for Kinsta sites then fallback to what PHP’s loaded ini…

Delete Inactive Themes

Removes all inactive themes. Replace keep_if_inactive with list of themes you wish to keep. WordPress recommends at least 1 default theme