How to Add Constants to your wp-config.php file

May 28, 2024 / WordPress

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:

  1. Log in to your server through FTP or SSH.
  2. Create and edit files through FTP or SSH.
  3. Scroll down in this file to locate the following line-
    /* That’s all, stop editing! Happy blogging. */
  4. 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”.

  5. Save the file.

If you view the plugin page now, you will notice that your credentials are not accessible.

That is it!

Spread the love