In this tutorial, we will explain how to add constants to your wp-config.php file. While configuring the WP Mail SMTP plugin, Google credentials are added to the WordPress dashboard.
The plugin recommends adding code to your wp-config.php file to further protect your credentials.
Let us follow the steps:
- Log in to your server through FTP or SSH.
- Create and edit files through FTP or SSH.
- Scroll down in this file to locate the following line-
/* That’s all, stop editing! Happy blogging. */
- Insert the following lines directly above this line.
define( ‘WPMS_ON’, true ); define( ‘WPMS_GMAIL_CLIENT_ID’, ‘********************.apps.googleusercontent.com’); define( ‘WPMS_GMAIL_CLIENT_SECRET’, ‘**********************’); define( ‘WPMS_MAILER’, ‘gmail’ );
Note- The only portions you need to modify are “WPMS_GMAIL_CLIENT_ID” and “WPMS_GMAIL_CLIENT_SECRET”.
- Save the file.
If you view the plugin page now, you will notice that your credentials are not accessible.
That is it!