Top Nav

Archive | WordPress

Regenerate WP-Rocket .htaccess From Command Line

To regenerate the .htaccess file with WP-Rocket rules from the command line do the following:

  • Install wp-rocket extension for wp-cli:

  • Regenerate the .htaccess file:

There are additional useful commands on the rocket extension. See for details.





Quick WordPress Install With wp-cli

These steps assume that wp-cli is installed and a database has been created.



WordPress SSL Termination Fix

Add this code to wp-config.php to stop redirect loops caused by SSL termination on a proxy or load balancer:



Change WordPress User Password With WP-CLI

WP-CLI is a great tool for managing WordPress sites from the command line. As an example you can quickly change a WordPress user’s password with WP-CLI. This can be very handy on sites that you don’t have a WordPress admin login. First, if you don’t already have WP-CLI installed then follow the instructions here:

Then “cd” to the root of the WordPress site and run the following command:

Where <user> is the username and <pass> is the new password.

Here’s an example:

You can actually update other user parameters with the “user update” sub-command. See the full docs here:





W3TC CDN – Updating Plugin Or Theme

If you’re using W3 Total Cache with an origin push CDN like RackSpace Cloud Files, then you may encounter problems when updating plugins or themes. After the new files are synced to the CDN there is a propagation delay before all nodes receive the new files. During this time the site may be broken for some users. Here’s a procedure to deal with this situation:

1. Install and activate the new plugin or theme.

2. In W3TC, syncronize the Custom files to CDN. (Performance -> CDN -> Upload Custom Files)

3. Add plugin or theme folder to the CDN exclusion list:

Performance -> CDN -> Rejected Files

Add this line:




4. Save and clear the page cache.

Now the site will pull the plugin or theme from the server instead of the CDN. But the new files will be propagating through the CDN.

5. In 24 hours or whatever the TTL for your CDN container, after the files have had a chance to propagate, remove the plugin or theme folder from the Rejected Files list and clear the page cache.

Now the site will pull the plugin or theme from the CDN.