If you have a website that requires you to add custom code snippets to the
wp-config.php file, on GridPane these changes won’t persist when you migrate your website to a new server or clone it to a new domain name. Due to the way cloning works, a new
wp-config.php will instead be generated in its place.
To remedy this, we have the
A Quick Intro to user-configs.php
user-configs.php is a custom GridPane solution for adding content to wp-config.php without actually adding it directly to the
Code placed in this file is treated in the same way by WordPress as if it was added to the
wp-config.php file. This is accomplished using the PHP include statement.
With this, you can make sure that your changes do persist over migrations/clones, by instead adding your code to the
user-configs.php file. Any code added here will not be written over at any point by any GridPane function.
NOTE: This wouldn’t transfer over if moving a WordPress site away from GridPane, but it will make it so moving and cloning sites within GP is smooth sailing.
user-configs.php file is located in:
You can edit it either directly on your server, or over SFTP.
Edit via SFTP
To connect to your server over SFTP, please check out the following articles: –
Once connected you can download the file over SFTP, make your edits, and then re-upload it to your server.
Edit via SSH
To connect to your server via SSH, see the following articles to get started:
Generate your SSH Key:
Add your SSH Key to GridPane:
Connect to your server:
Inside your server type the following command to edit your
user-configs.php, replacing “site.url” with your domain name:
Make your edits, and then save the file with CTRL+O. You can then exit the file with CTRL+X, and then exit your server with:
Once your edits are made you’re all set! If you migrate your website to a new server, or clone it to a new domain name, your custom edits will now persist.