EDITS.WS

Tag: wp mail smtp

  • How to Resend New User Welcome Emails in WordPress

    Do you want to resend welcome emails to your WordPress users?

    A welcome email helps build trust with new users and ensures that people remember your website and business.

    However, your welcome emails can sometimes end up in the spam folder, or users don’t receive the messages. That’s why it’s important to resend welcome emails.

    In this article, we will show you how to resend new user welcome emails in WordPress.

    How to Resend Welcome Emails to New Users in WordPress

    Why Resend Welcome Emails to New Users in WordPress?

    Creating welcome emails is a great way to customize the emails that new users receive when they register on your website. This helps build your brand and makes your site memorable for customers, members, and subscribers.

    However, the welcome emails that you send might not make it to your users’ inboxes. Plus, email providers like Gmail can also flag your emails as spam.

    One of the reasons for this issue is that WordPress hosting services don’t configure the mail function properly. As a result, your welcome emails fail to reach your users or land in the spam folder.

    To overcome this issue, you can use an SMTP (Simple Mail Transfer Protocol) service. It allows you to use an SMTP server to send WordPress emails and ensure that they reach your users.

    An SMTP service also allows you to log any emails that don’t get delivered so that you can easily resend them.

    That said, let’s look at how you can log welcome emails that didn’t reach new users in WordPress.

    How to Set Up Email Logs in WordPress

    WP Mail SMTP is the best SMTP service for WordPress. It’s super easy to use and connects with popular email services like SendLayer, SMTP.com, Brevo (Previously Sendinblue), Gmail, Office 365, and more.

    With WP Mail SMTP, you can track email deliverability in WordPress. The plugin keeps a record of every email sent from your website and lets you resend emails that haven’t been delivered.

    Note: You will need the WP Mail SMTP Pro version to use the Email Log feature and resend welcome emails to new users. There is also a free version of WP Mail SMTP that you can use to get started.

    First, you will need to install and activate the WP Mail SMTP plugin on your website. For more details, please see our guide on how to install a WordPress plugin.

    Upon activation, you can head over to WP Mail SMTP » Settings from your WordPress dashboard and then enter the license key.

    You can find the key in your WP Mail SMTP account area.

    WP Mail SMTP license key

    After entering the license key, go ahead and click the ‘Verify Key’ button.

    Next, you can scroll down to the Mailer section and choose how you would like to send your WordPress emails.

    Select SMTP mailer

    All you have to do is select your preferred mailer. The PHP mail will be selected by default, but we don’t recommend using this method as it’s unreliable.

    For more information, you can follow our detailed guide on how to use a free SMTP server to send WordPress emails.

    After that, you need to go to the Email Log tab in the WP Mail SMTP settings and check the box for the ‘Enable Log’ option.

    This way, you will be able to track email deliverability in WordPress.

    Turn on email logs

    When you enable the option, you will see additional email tracking settings under the Email Log tab.

    Go ahead and check the boxes for Log Email Content, Save Attachments, Open Email Tracking, and Click Link Tracking so that you will get more data about email deliverability.

    Additional email log settings

    Next, you can select the time period for keeping the email logs.

    Simply choose an option from the dropdown menu for ‘Log Retention Period’ and then click the ‘Save Settings’ button.

    Select log retention period

    How to Resend New User Welcome Emails

    After setting up email logs, you can now see which welcome emails didn’t reach your users and which ones need to be resent.

    To start, simply navigate to WP Mail SMTP » Email Log from your WordPress admin area.

    View email log opens and clicks

    The plugin will show all your emails in this section. You can see the email subject, who it’s been sent to, the source, and whether users opened and clicked the email.

    If you see a red dot for any email, it means it wasn’t delivered. On the other hand, a green dot shows the email has reached the user’s inbox.

    To resend a welcome email that didn’t get delivered, go ahead and click the ‘View Log’ option.

    View email logs for resend

    Now, you will see logs for the individual email.

    After that, navigate to the ‘Actions’ tab and click the ‘Resend’ button.

    Click resend button

    A popup window will now appear.

    Simply enter the recipient’s email address and click the ‘Yes’ button to resend the email.

    Click yes to resend email

    Next, if you see multiple emails that failed to deliver, you can use the bulk resend feature from the email log screen.

    Go ahead and check the box next to the emails you want to resend. After that, select the ‘Resend’ option from the Bulk Actions dropdown menu.

    Resend multiple emails

    When a popup window appears, you can click the ‘Yes’ button to resend multiple emails.

    That’s it! WP Mail SMTP will resend welcome emails and any other email that fails to reach your new users.

    Click yes to resend multiple emails

    We hope this article helped you learn how to resend new user welcome emails in WordPress. You may also want to check out our guide on how to choose the best website builder and our expert picks for the best WooCommerce plugins.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Resend New User Welcome Emails in WordPress first appeared on WPBeginner.

  • 42 Extremely Useful Tricks for the WordPress Functions File

    Are you wondering what you can do with the WordPress functions file?

    All WordPress themes come with a functions.php file. This file acts as a plugin, allowing theme developers and general users to add custom code in WordPress easily.

    In this article, we will show you some useful tricks for the WordPress functions file.

    Handy WordPress functions file tips and hacks

    What Is the Functions File in WordPress?

    The functions.php file is a WordPress theme file that comes with all free and premium WordPress themes.

    It acts as a plugin and allows theme developers to define theme features. Users can also use it to add their custom code snippets in WordPress.

    However, keeping custom code in your theme’s functions file is not the best way to save your customizations. If you update your theme, then the functions.php file will be overwritten, and you will lose your custom code snippets.

    Instead, we recommend everyone use WPCode, a free plugin that lets you insert code snippets into your WordPress website without editing any theme, plugin, or core WordPress files.

    The best part is that all your custom code is saved separately, so any WordPress updates won’t remove them.

    As a bonus, the WPCode plugin has an extensive library of pre-configured code snippets (including many on this list). You can deploy these code snippets with a few clicks.

    wpcode library

    Having said that, here is a list of items we will cover in this article. You can jump to one that interests you or simply follow along:

    How to Add These Code Snippets to Your Website

    Before we begin, let’s look at how to add the code snippets in this article to your WordPress functions file.

    1. Add Custom Code to Functions File Using WPCode (Recommended)

    First, you need to install and activate the WPCode plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Upon activation, go to Code Snippets » + Add Snippet page. You’ll see WPCode’s code library with many helpful custom code snippets already added.

    Add snippet

    If your code snippet does the same thing as of the snippets in the library, then you can try out the one already added there.

    Alternatively, click the ‘blank snippet’ link to continue adding your custom code snippet.

    On the next screen, provide a title for your custom code. This could be anything that helps you identify what this code snippet does.

    Adding your custom code

    Next, you need to choose the ‘Code Type’. If you are adding a code that works in the functions.php file, then you must select ‘PHP Snippet’.

    Below that, you need to copy and paste your custom code into the ‘Code Preview’ box.

    Finally, you need to set your snippet as ‘Active’ and click the ‘Save Snippet’ button.

    Activate and save

    Your saved snippet will now run like it would if you had added it to the functions.php file.

    You can repeat the process to add more snippets when needed. You can also deactivate a snippet without deleting it.

    2. Add Custom Code Directly to the Functions File

    The WPCode method is always better than adding code to the theme’s functions file.

    However, some users may be writing code for a client’s custom WordPress theme or simply prefer to add code to the functions.php file.

    In that case, here is how you can add code to your WordPress theme’s functions.php file.

    First, connect to your WordPress website using an FTP client. Once connected, navigate to the /wp-content/themes/your-wordpress-theme/ folder.

    Edit functions.php file

    There you will find the functions.php file. Simply right-click and select to edit or download the file to your computer for editing.

    You can edit it using any plain text editor like Notepad or TextEdit.

    Then, scroll down to the bottom of the functions.php file and paste your code snippet there. You can save your changes and upload the updated functions.php file to your theme folder.

    You can now visit your WordPress website to see your custom code in action.

    Now, let’s take a look at 42 different useful tricks for the WordPress functions file.

    1. Remove WordPress Version Number

    You should always use the latest version of WordPress. However, you may want to remove the WordPress version number from your site.

    Simply add this code snippet to your functions file or as a new WPCode snippet:

    function wpb_remove_version() {
    return '';
    }
    add_filter('the_generator', 'wpb_remove_version');
    

    For detailed instructions, see our guide on the right way to remove the WordPress version number.

    Want to white-label your WordPress admin area? Adding a custom dashboard logo is the first step in the process.

    First, you’ll need to upload your custom logo to your theme’s images folder as custom-logo.png. Your custom logo should be in a 1:1 ratio (a square image) in 16×16 pixels.

    After that, you can add this code to your theme’s functions file or as a new WPCode snippet:

    function wpb_custom_logo() {
    echo '
    <style type="text/css">
    #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
    background-image: url(' . get_bloginfo('stylesheet_directory') . '/images/custom-logo.png) !important;
    background-position: 0 0;
    color:rgba(0, 0, 0, 0);
    }
    #wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon {
    background-position: 0 0;
    }
    </style>
    ';
    }
    //hook into the administrative header output
    add_action('wp_before_admin_bar_render', 'wpb_custom_logo');
    

    For more details, see our guide on how to add a custom dashboard logo in WordPress.

    3. Change the Footer in WordPress Admin Panel

    The footer in the WordPress admin area shows the message ‘Thank you for creating with WordPress.’ You can change it to anything you want by adding this code:

    function remove_footer_admin () {
    
    echo 'Fueled by <a href="http://www.wordpress.org" target="_blank">WordPress</a> | WordPress Tutorials: <a href="https://www.wpbeginner.com" target="_blank">WPBeginner</a></p>';
    
    }
    
    add_filter('admin_footer_text', 'remove_footer_admin');
    

    Feel free to change the text and links that you want to add. Here is how it looks on our test site.

    Admin footer

    4. Add Custom Dashboard Widgets in WordPress

    You probably have seen the widgets that many plugins and themes add to the WordPress dashboard. You can add one yourself by pasting the following code:

    add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
    
    function my_custom_dashboard_widgets() {
    global $wp_meta_boxes;
    
    wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
    }
    
    function custom_dashboard_help() {
    echo '<p>Welcome to Custom Blog Theme! Need help? Contact the developer <a href="mailto:yourusername@gmail.com">here</a>. For WordPress Tutorials visit: <a href="https://www.wpbeginner.com" target="_blank">WPBeginner</a></p>';
    }
    

    This is what it would look like:

    Custom dashboard widget

    For details, see our tutorial on how to add custom dashboard widgets in WordPress.

    5. Change the Default Gravatar in WordPress

    Have you seen the default mystery man avatar on blogs? You can easily replace it with your own branded custom avatar.

    Simply upload the image you want to use as the default avatar and add this code to your functions file or the WPCode plugin:

    function wpb_custom_default_gravatar( $avatar_defaults ) {
    	$myavatar = 'https://example.com/wp-content/uploads/2022/10/dummygravatar.png';
    	$avatar_defaults[$myavatar] = 'Default Gravatar';
    	return $avatar_defaults;
    }
    add_filter( 'avatar_defaults', 'wpb_custom_default_gravatar' );
    

    Now you can head to the Settings » Discussion page and select your default avatar.

    Custom default gravatar

    For detailed instructions, see our guide on changing the default gravatar in WordPress.

    6. Dynamic Copyright Date in WordPress Footer

    You can simply add a copyright date by editing the footer template in your theme. However, it will not show when your site started, and it will not automatically change the following year.

    This code can add a dynamic copyright date in the WordPress footer:

    function wpb_copyright() {
    global $wpdb;
    $copyright_dates = $wpdb->get_results("
    SELECT
    YEAR(min(post_date_gmt)) AS firstdate,
    YEAR(max(post_date_gmt)) AS lastdate
    FROM
    $wpdb->posts
    WHERE
    post_status = 'publish'
    ");
    $output = '';
    if($copyright_dates) {
    $copyright = "© " . $copyright_dates[0]->firstdate;
    if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
    $copyright .= '-' . $copyright_dates[0]->lastdate;
    }
    $output = $copyright;
    }
    return $output;
    }
    

    After adding this function, you’ll need to open your footer.php file and add the following code where you would like to display the dynamic copyright date:

    <?php echo wpb_copyright(); ?>
    

    This function looks for the date of your first post and the date of your last post. It then returns the years wherever you call the function.

    Tip: If you are using the WPCode plugin, then you can combine the two code snippets. After that, choose the ‘Site Wide Footer’ location in the ‘Insertion’ section of the snippet settings. This will automatically display the copyright date in the footer without editing your theme’s footer.php file.

    Add to footer using WPCode

    For more details, see our guide on how to add dynamic copyright dates in WordPress.

    7. Randomly Change the Background Color in WordPress

    Do you want to randomly change the background color on your WordPress blog for each visit and page reload? Here is how to easily do this.

    First, add this code to your theme’s functions file or the WPCode plugin:

    function wpb_bg() {
    $rand = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
    $color ='#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].
    $rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
    
    echo $color; 
    } 
    

    Next, you’ll need to edit the header.php file in your theme. Find the <body> tag and add replace it with this line:

    <body <?php body_class(); ?> style="background-color:<?php wpb_bg();?>">
    

    You can now save your changes and visit your website to see this code in action.

    Random background colors

    For more details and alternate methods, see our tutorial on randomly changing the background color in WordPress.

    8. Update WordPress URLs

    If your WordPress login page keeps refreshing or you cannot access the admin area, then you need to update WordPress URLs.

    One way to do this is by using the wp-config.php file. However, if you do that, then you cannot set the correct address on the settings page. The WordPress URL and Site URL fields will be locked and uneditable.

    Instead, just add this code to your functions file to fix this:

    update_option( 'siteurl', 'https://example.com' );
    update_option( 'home', 'https://example.com' );
    

    Don’t forget to replace example.com with your domain name.

    Once logged in, you can go to the Settings page in the WordPress admin area and set the URLs.

    After that, you should remove the code you added to the functions file or WPCode. Otherwise, it will keep updating those URLs whenever your site is accessed.

    9. Add Additional Image Sizes in WordPress

    WordPress automatically generates several image sizes when you upload an image. You can also create additional image sizes to use in your theme.

    Simply add this code to your theme’s functions file or as a WPCode snippet:

    add_image_size( 'sidebar-thumb', 120, 120, true ); // Hard Crop Mode
    add_image_size( 'homepage-thumb', 220, 180 ); // Soft Crop Mode
    add_image_size( 'singlepost-thumb', 590, 9999 ); // Unlimited Height Mode
    

    This code creates three new image sizes of different sizes. Feel free to tweak the code to meet your requirements.

    You can then display an image size anywhere in your theme using this code:

    <?php the_post_thumbnail( 'homepage-thumb' ); ?>
    

    For detailed instructions, see our guide on creating additional image sizes in WordPress.

    10. Add New Navigation Menus to Your Theme

    WordPress allows theme developers to define navigation menus and then display them.

    You can add this code to your theme’s functions file or as a new WPCode snippet to define a new menu location in your theme:

    function wpb_custom_new_menu() {
      register_nav_menu('my-custom-menu',__( 'My Custom Menu' ));
    }
    add_action( 'init', 'wpb_custom_new_menu' );
    

    You can now go to Appearance » Menus in your WordPress dashboard and see ‘My Custom Menu’ as the theme location option.

    Custom menu location

    Note: This code will also work with block themes with the full site editing feature. Adding it will enable the Menus screen under Appearance.

    Now you need to add this code to your theme where you want to display the navigation menu:

     <?php
    wp_nav_menu( array( 
        'theme_location' => 'my-custom-menu', 
        'container_class' => 'custom-menu-class' ) ); 
    ?>
    

    For detailed instructions, see our guide on how to add custom navigation menus in WordPress themes.

    11. Add Author Profile Fields

    Do you want to add extra fields to your author profiles in WordPress? You can easily do that by adding this code to your functions file or as a new WPCode snippet:

    function wpb_new_contactmethods( $contactmethods ) {
    // Add Twitter
    $contactmethods['twitter'] = 'Twitter';
    //add Facebook
    $contactmethods['facebook'] = 'Facebook';
    
    return $contactmethods;
    }
    add_filter('user_contactmethods','wpb_new_contactmethods',10,1);
    

    This code will add Twitter and Facebook fields to user profiles in WordPress.

    New profile fields

    You can now display these fields in your author template like this:

    <?php echo get_the_author_meta('twitter') ?>
    

    You may also want to see our guide on adding additional user profile fields in WordPress registration.

    12. Adding Widget-Ready Areas or Sidebars in WordPress Themes

    This is one of the most used code snippets, and many developers already know about adding widget-ready areas or sidebars to WordPress themes. But it deserves to be on this list for those people who don’t know.

    You can paste the following code in your functions.php file or as a new WPCode snippet:

    // Register Sidebars
    function custom_sidebars() {
    
    	$args = array(
    		'id'            => 'custom_sidebar',
    		'name'          => __( 'Custom Widget Area', 'text_domain' ),
    		'description'   => __( 'A custom widget area', 'text_domain' ),
    		'before_title'  => '<h3 class="widget-title">',
    		'after_title'   => '</h3>',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget'  => '</aside>',
    	);
    	register_sidebar( $args );
    
    }
    add_action( 'widgets_init', 'custom_sidebars' );
    

    Note: This code will also work with block themes with the full site editing feature. Adding it will enable the Widgets screen under Appearance.

    You can now visit the Appearance » Widgets page and see your new custom widget area.

    Custom widget area

    To display this sidebar or widget-ready area on your website, you’ll need to add the following code in the template where you want to display it:

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('custom_sidebar') ) : ?>
    <!–Default sidebar info goes here–>
    <?php endif; ?>
    

    For more details, see our guide on how to add dynamic widget-ready areas and sidebars in WordPress.

    13. Manipulate the RSS Feed Footer

    Have you seen blogs that add their advertisements in their RSS feeds below each post? You can accomplish this easily with a simple function. Just paste the following code:

    function wpbeginner_postrss($content) {
    if(is_feed()){
    $content = 'This post was written by Syed Balkhi '.$content.'Check out WPBeginner';
    }
    return $content;
    }
    add_filter('the_excerpt_rss', 'wpbeginner_postrss');
    add_filter('the_content', 'wpbeginner_postrss');
    

    For more information, see our guide on how to add content and completely manipulate your RSS feeds.

    14. Add Featured Images to RSS Feeds

    The post thumbnail or featured images are usually only displayed within your site design. You can easily extend that functionality to your RSS feed with the following code:

    function rss_post_thumbnail($content) {
    global $post;
    if(has_post_thumbnail($post->ID)) {
    $content = '<p>' . get_the_post_thumbnail($post->ID) .
    '</p>' . get_the_content();
    }
    return $content;
    }
    add_filter('the_excerpt_rss', 'rss_post_thumbnail');
    add_filter('the_content_feed', 'rss_post_thumbnail');
    

    For more details, see our guide on how to add post thumbnails to your WordPress RSS feed.

    15. Hide Login Errors in WordPress

    Hackers can use login errors to guess whether they entered the wrong username or password. By hiding login errors in WordPress, you can make your login area and WordPress website more secure.

    Simply add the following code to your theme’s functions file or as a new WPCode snippet:

    function no_wordpress_errors(){
      return 'Something is wrong!';
    }
    add_filter( 'login_errors', 'no_wordpress_errors' );
    

    Now, users will see a generic message when they enter an incorrect username or password.

    Custom login errors

    For more information, see our tutorial on disabling login hints in WordPress error messages.

    16. Disable Login by Email in WordPress

    WordPress allows users to log in with their username or email address. You can easily disable login by email in WordPress by adding this code to your functions file or as a new WPCode snippet:

    remove_filter( 'authenticate', 'wp_authenticate_email_password', 20 );
    

    For more information, see our guide on how to disable login by email feature in WordPress.

    17. Disable Search Feature in WordPress

    If you want to disable your WordPress site’s search feature, simply add this code to your functions file or in a new WPCode snippet:

    function wpb_filter_query( $query, $error = true ) {
    if ( is_search() ) {
    $query->is_search = false;
    $query->query_vars[s] = false;
    $query->query[s] = false;
    if ( $error == true )
    $query->is_404 = true;
    }}
    

    This code simply disables the search query by modifying it and returning a 404 error instead of search results.

    For more information, see our tutorial on disabling the WordPress search feature.

    Pro Tip: Instead of giving up on WordPress search, we recommend trying out SearchWP. It is the best WordPress search plugin on the market that allows you to add a powerful and customizable search feature to your website.

    18. Delay Posts in RSS Feed

    Sometimes you may publish an article with a grammatical error or spelling mistake.

    The mistake goes live and is distributed to your RSS feed subscribers. If you have email subscriptions on your WordPress blog, then those subscribers will also get a notification.

    Simply add this code to your theme’s functions file or as a new WPCode snippet to delay posts in your RSS feed:

    function publish_later_on_feed($where) {
    
    	global $wpdb;
    
    	if ( is_feed() ) {
    		// timestamp in WP-format
    		$now = gmdate('Y-m-d H:i:s');
    
    		// value for wait; + device
    		$wait = '10'; // integer
    
    		// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
    		$device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
    
    		// add SQL-sytax to default $where
    		$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
    	}
    	return $where;
    }
    
    add_filter('posts_where', 'publish_later_on_feed');
    

    In this code, we used 10 minutes as $wait or delay time. Feel free to change this to any number of minutes you want.

    For a plugin method and more information, see our detailed guide on how to delay posts from appearing in the WordPress RSS feed.

    19. Change Read More Text for Excerpts in WordPress

    Do you want to change the text that appears after the excerpt in your posts? Simply add this code to your theme’s functions file or as a new WPCode snippet:

    function modify_read_more_link() {
        return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>';
    }
    add_filter( 'the_content_more_link', 'modify_read_more_link' );
    

    20. Disable RSS Feeds in WordPress

    Not all websites need RSS feeds. If you want to disable RSS feeds on your WordPress site, then add this code to your theme’s functions file or as a new WPCode snippet:

    function new_excerpt_more($more) {
     global $post;
     return '<a class="moretag" 
     href="'. get_permalink($post->ID) . '">Your Read More Link Text</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    

    For a plugin method and more information, see our guide on how to disable RSS feeds in WordPress.

    21. Change Excerpt Length in WordPress

    WordPress limits excerpt lengths to 55 words. You can add this code to your functions file or as a new WPCode snippet if you need to change that:

    function new_excerpt_length($length) {
    return 100;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    

    Just change 100 to the number of words you want to show in the excerpts.

    For alternate methods, you may want to look at our guide on how to customize WordPress excerpts (no coding required).

    22. Add an Admin User in WordPress

    If you have forgotten your WordPress password and email, then you can add an admin user by adding this code to your theme’s functions file using an FTP client:

    function wpb_admin_account(){
    $user = 'Username';
    $pass = 'Password';
    $email = 'email@domain.com';
    if ( !username_exists( $user )  && !email_exists( $email ) ) {
    $user_id = wp_create_user( $user, $pass, $email );
    $user = new WP_User( $user_id );
    $user->set_role( 'administrator' );
    } }
    add_action('init','wpb_admin_account');
    

    Don’t forget to fill in the username, password, and email fields.

    Important: Once you log in to your WordPress site, don’t forget to delete the code from your functions file.

    For more on this topic, take a look at our tutorial on how to add an admin user in WordPress using FTP.

    23. Disable Language Switcher on Login Page

    If you run a multilingual website, then WordPress displays a language selector on the login page. You can easily disable it by adding the following code to your functions.php file or as a new WPCode snippet:

    add_filter( 'login_display_language_dropdown', '__return_false' );
    

    24. Show the Total Number of Registered Users in WordPress

    Do you want to show the total number of registered users on your WordPress site? Simply add this code to your theme’s functions file or as a new WPCode snippet:

    function wpb_user_count() {
    $usercount = count_users();
    $result = $usercount['total_users'];
    return $result;
    }
    // Creating a shortcode to display user count
    add_shortcode('user_count', 'wpb_user_count');
    

    This code creates a shortcode that allows you to display the total number of registered users on your site.

    Now you just need to add the shortcode [user_count] to your post or page where you want to show the total number of users.

    For more information and a plugin method, see our tutorial on how to display the total number of registered users in WordPress.

    25. Exclude Specific Categories From RSS Feed

    Do you want to exclude specific categories from your WordPress RSS feed? You can add this code to your theme’s functions file or as a new WPCode snippet:

    function exclude_category($query) {
    	if ( $query->is_feed ) {
    		$query->set('cat', '-5, -2, -3');
    	}
    return $query;
    }
    add_filter('pre_get_posts', 'exclude_category');
    

    26. Disable URL Links in WordPress Comments

    By default, WordPress converts a URL into a clickable link in comments.

    You can stop this by adding the following code to your functions file or as a new WPCode snippet:

    remove_filter( 'comment_text', 'make_clickable', 9 );
    

    For details, see our article on how to disable autolinking in WordPress comments.

    27. Add Odd and Even CSS Classes to WordPress Posts

    You may have seen WordPress themes using an odd or even class for WordPress comments. It helps users visualize where one comment ends and the next one begins.

    You can use the same technique for your WordPress posts. It looks aesthetically pleasing and helps users quickly scan pages with lots of content.

    Simply add this code to your theme’s functions file:

    function oddeven_post_class ( $classes ) {
       global $current_class;
       $classes[] = $current_class;
       $current_class = ($current_class == 'odd') ? 'even' : 'odd';
       return $classes;
    }
    add_filter ( 'post_class' , 'oddeven_post_class' );
    global $current_class;
    $current_class = 'odd';
    

    This code simply adds an odd or even class to WordPress posts. You can now add custom CSS to style them differently.

    Here is some sample code to help you get started:

    .even {
    background:#f0f8ff;
    }
    .odd {
     background:#f4f4fb;
    }
    

    The end result will look something like this:

    Alternating background colors

    Need more detailed instructions? Take a look at our tutorial on how to add odd/even classes to your posts in WordPress themes.

    28. Add Additional File Types to Be Uploaded in WordPress

    By default, WordPress allows you to upload a limited number of the most commonly used file types. However, you can extend it to allow other file types.

    Just add this code to your theme’s functions file:

    function my_myme_types($mime_types){
        $mime_types['svg'] = 'image/svg+xml'; //Adding svg extension
        $mime_types['psd'] = 'image/vnd.adobe.photoshop'; //Adding photoshop files
        return $mime_types;
    }
    add_filter('upload_mimes', 'my_myme_types', 1, 1);
    

    This code allows you to upload SVG and PSD files to WordPress.

    You will need to find the mime types for the file types you want to allow and then use them in the code.

    For more on this topic, check out our tutorial on how to add additional file types to be uploaded in WordPress.

    WordPress uses a non-existent email address (wordpress@yourdomain.com) to send outgoing emails by default.

    This email address could be flagged as spam by email service providers.

    Using the WP Mail SMTP plugin is the proper way to fix this.

    WP Mail SMTP

    It fixes email deliverability issues and allows you to choose an actual email address to send your WordPress emails.

    To learn more, see our guide on how to fix WordPress not sending email issue.

    On the other hand, if you want to quickly change this to a real email address, then you can add the following code in your functions file or as a new WPCode snippet:

    // Function to change email address
    function wpb_sender_email( $original_email_address ) {
        return 'tim.smith@example.com';
    }
     
    // Function to change sender name
    function wpb_sender_name( $original_email_from ) {
        return 'Tim Smith';
    }
     
    // Hooking up our functions to WordPress filters 
    add_filter( 'wp_mail_from', 'wpb_sender_email' );
    add_filter( 'wp_mail_from_name', 'wpb_sender_name' );
    

    Don’t forget to replace the email address and name with your own information.

    The problem with this method is that WordPress is still using the mail() function to send emails, and such emails are most likely to end up in spam.

    For better alternatives, see our tutorial on how to change the sender name in outgoing WordPress emails.

    30. Add an Author Info Box in WordPress Posts

    If you run a multi-author site and want to showcase author bios at the end of your posts, then you can try this method.

    Start by adding this code to your functions file or as a new WPCode snippet:

    function wpb_author_info_box( $content ) {
    
    global $post;
    
    // Detect if it is a single post with a post author
    if ( is_single() && isset( $post->post_author ) ) {
    
    // Get author's display name
    $display_name = get_the_author_meta( 'display_name', $post->post_author );
    
    // If display name is not available then use nickname as display name
    if ( empty( $display_name ) )
    $display_name = get_the_author_meta( 'nickname', $post->post_author );
    
    // Get author's biographical information or description
    $user_description = get_the_author_meta( 'user_description', $post->post_author );
    
    // Get author's website URL
    $user_website = get_the_author_meta('url', $post->post_author);
    
    // Get link to the author archive page
    $user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));
    	
    // Get User Gravatar
    $user_gravatar =  get_avatar( get_the_author_meta( 'ID' , $post->post_author) , 90 );
    
    if ( ! empty( $display_name ) )
    
    $author_details = '<p class="author_name">About ' . $display_name . '</p>';
    
    if ( ! empty( $user_description ) )
    // Author avatar and bio will be displayed if author has filled in description. 
    
    $author_details .= '<p class="author_details">' . $user_gravatar . nl2br( $user_description ). '</p>';
    
    $author_details .= '<p class="author_links"><a href="'. $user_posts .'">View all posts by ' . $display_name . '</a>';  
    
    // Check if author has a website in their profile
    if ( ! empty( $user_website ) ) {
    
    // Display author website link
    $author_details .= ' | <a href="' . $user_website .'" target="_blank" rel="nofollow noopener">Website</a></p>';
    
    } else {
    // if there is no author website then just close the paragraph
    $author_details .= '</p>';
    }
    
    // Pass all this info to post content
    $content = $content . '<footer class="author_bio_section" >' . $author_details . '</footer>';
    }
    return $content;
    }
    
    // Add our function to the post content filter
    add_action( 'the_content', 'wpb_author_info_box' );
    
    // Allow HTML in author bio section
    remove_filter('pre_user_description', 'wp_filter_kses');
    

    Next, you will need to add some custom CSS to make it look better.

    You can use this sample CSS as a starting point:

    .author_bio_section{
    background: none repeat scroll 0 0 #F5F5F5;
    padding: 15px;
    border: 1px solid #ccc;
    }
    
    .author_name{
    font-size:16px;
    font-weight: bold;
    }
    
    .author_details img {
    border: 1px solid #D8D8D8;
    border-radius: 50%;
    float: left;
    margin: 0 10px 10px 0;
    }
    

    This is how your author box will look like:

    Author bio box

    For a plugin method and more detailed instructions, check out our article on how to add an author info box in WordPress posts.

    31. Disable XML-RPC in WordPress

    XML-RPC is a method that allows third-party apps to communicate with your WordPress site remotely. This could cause security issues and can be exploited by hackers.

    To turn off XML-RPC in WordPress, add the following code to your functions file or as a new WPCode snippet:

    add_filter('xmlrpc_enabled', '__return_false');
    

    You may want to read our article on how to disable XML-RPC in WordPress for more information.

    32. Automatically Link Featured Images to Posts

    If your WordPress theme does not automatically link featured images to full articles, then you can try this method.

    Simply add this code to your theme’s functions file or as a new WPCode snippet:

    function wpb_autolink_featured_images( $html, $post_id, $post_image_id ) {
    
    If (! is_singular()) { 
    
    $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . $html . '</a>';
    return $html;
    
    } else { 
    
    return $html;
    
    }
    
    }
    add_filter( 'post_thumbnail_html', 'wpb_autolink_featured_images', 10, 3 );
    

    You may want to read our article on how to automatically link featured images to posts in WordPress.

    33. Disable Block Editor in WordPress

    WordPress uses a modern and intuitive editor for writing content and editing your website. This editor uses blocks for commonly-used content and layout elements, which is why it’s called the Block Editor.

    However, you may need to use the older Classic Editor in some use cases.

    The easiest way to disable the block editor is by using the Classic Editor plugin. However, if you don’t want to use a separate plugin, then just add the following code to your functions file or as a new WPCode snippet:

    add_filter('gutenberg_can_edit_post', '__return_false', 5);
    add_filter('use_block_editor_for_post', '__return_false', 5);
    

    For more details, see our tutorial on how to disable the Block Editor and use the Classic Editor.

    34. Disable Block Widgets in WordPress

    WordPress switched from classic widgets to block widgets in WordPress 5.8. The new block widgets are easier to use and give you more design control than classic widgets.

    However, some users may still want to use classic widgets. In that case, you can use the following code in your theme’s functions file or as a new WPCode snippet:

    add_filter( 'use_widgets_block_editor', '__return_false' );
    

    For more details, see our article on how to disable widget blocks (restore classic widgets).

    35. Display the Last Updated Date in WordPress

    When visitors view a post or page on your WordPress blog, your WordPress theme will show the date the post was published. This is fine for most blogs and static websites.

    However, WordPress is also used by websites where old articles are regularly updated. In these publications, displaying the date and time the post was last modified is essential.

    Last updated date

    You can show the last updated date using the following code in your theme’s functions file or as a new WPCode snippet:

    $u_time          = get_the_time( 'U' );
    $u_modified_time = get_the_modified_time( 'U' );
    // Only display modified date if 24hrs have passed since the post was published.
    if ( $u_modified_time >= $u_time + 86400 ) {
    
    	$updated_date = get_the_modified_time( 'F jS, Y' );
    	$updated_time = get_the_modified_time( 'h:i a' );
    
    	$updated = '<p class="last-updated">';
    
    	$updated .= sprintf(
    	// Translators: Placeholders get replaced with the date and time when the post was modified.
    		esc_html__( 'Last updated on %1$s at %2$s' ),
    		$updated_date,
    		$updated_time
    	);
    	$updated .= '</p>';
    
    	echo wp_kses_post( $updated );
    }
    

    For alternate methods and more details, see our guide on how to display the last updated date in WordPress.

    36. Use Lowercase Filenames for Uploads

    If you run a multi-author website, then authors may upload images with filenames in upper and lowercase.

    Adding the following code ensures that all filenames are in lowercase:

    add_filter( 'sanitize_file_name', 'mb_strtolower' );
    

    Note: The code will not change filenames for existing uploads. For alternate methods, see our tutorial on how to rename images and media files in WordPress.

    37. Disable WordPress Admin Bar on Frontend

    By default, WordPress displays the admin bar at the top when a logged-in user views your website.

    You can disable the admin bar for all users except site administrators. Simply add the following code to your functions file or as a new WPCode snippet:

    /* Disable WordPress Admin Bar for all users */
    add_filter( 'show_admin_bar', '__return_false' );
    

    For more details, see our guide on how to disable the WordPress admin bar for all users except administrators.

    38. Change Howdy Admin Text in Admin Area

    WordPress displays a ‘Howdy Admin’ greeting in the WordPress dashboard. ‘Admin’ is replaced by the logged-in user’s name.

    Howdy greeting

    You can change the default greeting to your own by adding the following code in your functions file or as a new WPCode snippet:

    function wpcode_snippet_replace_howdy( $wp_admin_bar ) {
    
    	// Edit the line below to set what you want the admin bar to display intead of "Howdy,".
    	$new_howdy = 'Welcome,';
    
    	$my_account = $wp_admin_bar->get_node( 'my-account' );
    	$wp_admin_bar->add_node(
    		array(
    			'id'    => 'my-account',
    			'title' => str_replace( 'Howdy,', $new_howdy, $my_account->title ),
    		)
    	);
    }
    
    add_filter( 'admin_bar_menu', 'wpcode_snippet_replace_howdy', 25 );
    

    For more details, see our article on changing the ‘Howdy Admin’ message in WordPress.

    39. Disable Code Editing in Block Editor

    The block editor allows you to switch to the Code Editor. This comes in handy if you need to add some HTML code manually.

    However, you may want to keep this feature limited to site administrators.

    You can add the following code to your functions file or as a WPCode snippet to achieve this:

    add_filter( 'block_editor_settings_all', function ( $settings ) {
    	
    	$settings['codeEditingEnabled'] = current_user_can( 'manage_options' );
    
    	return $settings;
    } );
    

    40. Disable Plugin / Theme File Editor

    WordPress comes with a built-in editor where you can edit plugin files. You can see it by going to the Plugins » Plugin File Editor page.

    Plugin file editor in WordPress

    Similarly, WordPress also includes a file editor for classic themes at Appearance » Theme File Editor.

    Note: If you use a block theme, then the theme file editor is not visible.

    Theme file editor

    We don’t recommend using these editors for making changes to your theme or plugin. A tiny mistake in code can make your website inaccessible to all users.

    To disable the plugin/theme editor, add the following code to your functions file or as a WPCode snippet:

    // Disable the Plugin and Theme Editor
    if ( ! defined( 'DISALLOW_FILE_EDIT' ) ) {
    	define( 'DISALLOW_FILE_EDIT', true );
    }
    

    For more details, see our tutorial on how to disable the plugin/theme editor in WordPress.

    41. Disable New User Notification Emails

    By default, WordPress sends an email notification when a new user joins your WordPress website.

    If you run a WordPress membership website or require users to signup, then you will get a notification each time a user joins your website.

    To turn off these notifications, you can add the following to your functions file or as a new WPCode snippet:

    function wpcode_send_new_user_notifications( $user_id, $notify = 'user' ) {
    	if ( empty( $notify ) || 'admin' === $notify ) {
    		return;
    	} elseif ( 'both' === $notify ) {
    		// Send new users the email but not the admin.
    		$notify = 'user';
    	}
    	wp_send_new_user_notifications( $user_id, $notify );
    }
    
    add_action(
    	'init',
    	function () {
    		// Disable default email notifications.
    		remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
    		remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications' );
    
    		// Replace with custom function that only sends to user.
    		add_action( 'register_new_user', 'wpcode_send_new_user_notifications' );
    		add_action( 'edit_user_created_user', 'wpcode_send_new_user_notifications', 10, 2 );
    	}
    );
    

    For more details, see our tutorial on how to disable new user email notifications in WordPress.

    42. Disable Automatic Update Email Notifications

    Occasionally, WordPress may automatically install security and maintenance updates or update a plugin with a critical vulnerability.

    It sends an automatic update email notification after each update. If you manage multiple WordPress websites, then you may get several such emails.

    You can add this code to your functions file or as a new WPCode snippet to turn off these email notifications:

    / Disable auto-update emails.
    add_filter( 'auto_core_update_send_email', '__return_false' );
    
    // Disable auto-update emails for plugins.
    add_filter( 'auto_plugin_update_send_email', '__return_false' );
    
    // Disable auto-update emails for themes.
    add_filter( 'auto_theme_update_send_email', '__return_false' );
    

    To learn more, see our article on how to disable automatic update emails in WordPress.

    We hope this article helped you learn some new useful tricks for the functions.php file in WordPress. You may also want to see our ultimate guide to boost WordPress speed and performance and our expert picks for the best code editors for Mac and Windows.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post 42 Extremely Useful Tricks for the WordPress Functions File first appeared on WPBeginner.

  • How to Share Users and Logins Between Multiple WordPress Sites

    Do you want to share users and logins between multiple WordPress sites?

    Sharing customer, member, or visitor information between multiple sites can improve the user experience, by allowing them to log into multiple sites with the same account. It can also save you a ton of time if you need to add employees, students, or other users to several sites.

    In this article, we will show you how you can share users and logins between multiple WordPress websites.

    Automatically share users and logins between multiple WordPress sites

    Why Share Users and Logins Between Multiple WordPress Sites?

    If you have multiple websites, then you may want to share users and login information between them.

    This can save your visitors time and effort since they only need to complete the user registration form once. For example, you might have a WordPress blog and a website where you sell online courses.

    If someone purchases a course from your blog, then you can automatically add them to the site that has the learning management system (LMS). The user can then log into the LMS and start working on their course, without having to register using their email address, username, and other information.

    If you’re a WordPress development agency or you work on multiple client sites, then you may need to manually create several accounts for each developer, tester, and other staff member. Instead, you can save time by registering each person once and then sharing login information between all the client sites.

    With that in mind, let’s see how you can share users and logins between WordPress websites.

    How to Share Users and Logins Between Multiple WordPress Sites

    The best way to share users and login information is by using Uncanny Automator. It’s the best WordPress automation plugin and helps you create automated workflows that can save you a ton of time and effort.

    When it comes to connecting several sites, many people assume you need to set up a WordPress multisite network. However, it’s often easier to use webhooks. These are bits of code that allow different tools and apps to share information in real time.

    After installing Uncanny Automator, you can use webhooks to share information between WordPress websites, including user accounts and login details.

    To start, you’ll need to install Uncanny Automator on the website where users will create their original account. We’ll call this the ‘source’ website.

    You’ll then need to install Uncanny Automator on every website that should receive data from the source site.

    Finally, you’ll use automation recipes and webhooks to send user information from the source to all the other websites that need this information.

    With that in mind, let’s walk through the steps in more detail.

    Add Uncanny Automator to the Source Website

    The first thing you need to do is install and activate Uncanny Automator on your source website. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Note: There is a free Uncanny Automator plugin that lets you automate many common tasks and comes with 300 automation triggers and actions. However, we’ll be using Uncanny Automator Pro because you need it to use the ‘A user is created’ trigger.

    Upon activation, you’ll be asked to install the free version of Uncanny Automator core. The free plugin has limited features, but it’s used as the base for the Pro version.

    With that done, you need to head over to Automator » Settings and enter your license key.

    The Uncanny Automator automation WordPress plugin

    You can find this information under your account on the Uncanny Automator website.

    After entering the key, click on the ‘Activate License’ button.

    Create a New Automation Recipe

    Upon activation, you’re ready to create automated workflows in WordPress. Uncanny Automator calls these workflows ‘recipes.’

    You’re going to create a recipe that sends information to a webhook, every time a user registers with your WordPress website.

    To get started, simply head to Automator » Add New. Uncanny Automator will now ask whether you want to create a ‘Logged-in’ recipe or an ‘Everyone’ recipe.

    Logged-in recipes can only be triggered by logged-in users, but anyone can trigger ‘Everyone’ recipes. With that being said, select ‘Logged-in’ and then click on ‘Confirm.’

    Creating a new automated workflow in WordPress

    You can now give this recipe a title, by typing into the ‘Title’ field.

    This is just for your reference, so you can use anything you want.

    How to share login information between multiple WordPress websites

    Add Triggers and Actions to the Automated Workflow

    Each recipe in Uncanny Automator has two parts called Triggers and Actions.

    A trigger is any event that starts the automated workflow, such as adding new users and authors to your WordPress blog. Actions are the tasks the recipe will perform, such as sharing information with another website, blog, or online store.

    To start, you’ll need to set the trigger by choosing an integration.

    Uncanny Automator supports many popular WordPress plugins including WPForms, WooCommerce, and OptinMonster. The options you see may vary depending on the plugins you’ve installed.

    To get started, select ‘WordPress’ and then click on ‘A user is created.’

    How to share user information between multiple blogs or websites

    Next, you need to tell Uncanny Automator what it should do when the recipe gets triggered.

    To do this, click the ‘Add action’ button.

    Sharing data between WordPress websites using a webhook

    Uncanny Automator will now show all the different integrations you can use in the action.

    To send data to a webhook, click on ‘Webhooks.’

    How to create user accounts automatically using Uncanny Automator

    This adds a new dropdown menu.

    Here, select ‘Send data to a webhook.’

    Sending data to a WordPress webhook using Uncanny Automator

    You’ll now see a new section where you can set up the webhook.

    For now, scroll to the ‘Body’ section.

    Sharing usernames and emails between multiple websites

    Here, you need to specify the data Uncanny Automator should pass to the receiving WordPress blogs or websites. As an example, we’ll show you how to share the user’s email address, first name, and username. We will not be sharing the user’s password via Uncanny Automator.

    Instead, Uncanny Automator will generate a random temporary password. Later in this guide, we’ll show you how to send an email containing a password reset link, so users can easily create their own password.

    Pro Tip: It is best practice to use a unique password for every account. For more on this topic, please see our ultimate WordPress security guide.

    To go ahead and share the user’s email address, click on the field under ‘Key’ and type in ‘Email.’ You’ll be using the key in your webhook, so make a note of it.

    Retrieving the user's email address from a webhook

    Under ‘Data Type,’ choose ‘Text’ if it isn’t already selected.

    Now, click on the asterisk next to ‘Value.’

    Getting data from a webhook using an automation plugin

    This opens a dropdown with all the different data you can share. For example, you might share the person’s username, first name, and last name.

    To share the user’s email address, click on ‘Common’ and then select ‘User email.’

    Adding dynamic tokens to an automated WordPress workflow

    You’ll typically want to share additional information, such as the user’s first name and last name.

    To share more information, go ahead and click the ‘Add Pair’ button.

    Adding additional key/value pairs to an Uncanny Automator workflow

    Then, type in a key, select the data type, and choose a value from the dropdown menu by following the same process described above.

    For example, in the following image, we’re sharing the email, first name, and username.

    Adding key/value pairs to an automated workflow

    This recipe is almost complete, but you still need to type in the webook’s URL. To get this link, you’ll need to set up Uncanny Automator on the website that will receive the data.

    With that being said, leave the source website open in a background tab, and open a new tab.

    Receive User Login Information using a Webhook

    In the new tab, log into the website, blog, or WooCommerce store that will receive the user information and login data. You can now install and activate the Uncanny Automator plugin by following the same process described above.

    With that done, it’s time to create a recipe that’ll retrieve the data from the webhook, and add it to a new user account.

    To get started, head over to Automator » Add New. In the popup that appears, click on ‘Everyone’ and then select ‘Confirm.’

    How to create a recipe for all users

    You can now type in a title for the automated workflow.

    Once again, this is just for your reference so you can use anything you want.

    How to receive data from a webhook on your website or blog

    Under ‘Integrations,’ select ‘Webhooks.’

    In the dropdown that appears, select ‘Receive data from a webhook.’

    Receiving data from a WordPress webhook

    This adds a new section, with the ‘Webhook URL’ already filled in. In a later step, you’ll add this URL to the source website.

    For now, scroll to the ‘Fields’ section. Here, you’ll need to configure all the information you’ll retrieve from the webhook. These are simply the key/value pairs you created in the first automation recipe.

    Under ‘Key,’ type in the exact key you used for the first piece of information. If you capitalized ‘Email’ earlier, capitalize it here, too.

    Adding keys to a WordPress website or blog

    After that, open the ‘Value Type’ dropdown and choose ‘Text.’

    To configure the next key/value pair, click on ‘Add Pair.’ You can now simply repeat these steps to add all the key/value pairs.

    Mapping keys and values in WordPress

    With that done, click on ‘Save.’

    Set the User Data in Uncanny Automator

    If you’ve been following along, then Uncanny Automator will now share the user’s email address, username, and first name with this new website.

    As we already mentioned, the recipe will create a password at random, so you’ll need to give visitors an easy way to reset their password.

    The easiest way is by sending an email containing a link to your password reset page. You can also include other useful information, such as the person’s username, a link to your website, and your contact information.

    To get started, click on the ‘Add action’ button.

    Adding actions to an automated recipe in Uncanny Automator

    Uncanny Automator will now show all the different integrations you can use.

    Go ahead and click on ‘Emails.’

    How to send an email automatically

    In the dropdown that appears, select ‘Send an email.’

    This adds a new section with some settings already filled in. For example, by default Uncanny Automator will send all messages from your WordPress admin email. It will also use your site name as the ‘From name.’

    Automatically send emails using an Uncanny Automator recipe

    To change any of these settings, simply delete the default value.

    Then, either type in the value you want to use instead, or click the asterisk and choose a token from the dropdown menu. These tokens will be replaced with real information when the recipe runs, so they’re a great way to show personalized content to different users.

    Changing the default email automation settings

    Your next task is getting the user’s email address from the webhook.

    To do this, find the ‘To’ field and then click on its asterisk.

    Adding dynamic tokens to an automated workflow

    Next, click to expand the ‘Common’ section.

    When it appears, click on ‘User email.’

    How to share logins and user accounts between multiple websites

    Uncanny Automator will now show a popup, explaining that you need to specify where the user information will come from.

    In the popup, click on ‘Set user data.’

    Settings user data in an automation workflow

    Now, if you scroll up you’ll see a new ‘Actions will be run on…’ section.

    You want to create a new user account every time the recipe runs, so select ‘New User.’

    Automatically creating a new user

    You now need to map each field to information retrieved from the webhook. Some of these fields are mandatory, such as the username and email address, but others are optional such as the display name.

    To get started, simply find the first field where you want to map some data, and then click on its asterisk button.

    Mapping data to a webhook

    In the dropdown, click to expand the ‘Receive data from a webhook’ section.

    You can now choose the information that you want to show in this field. In our images, we’re retrieving the user’s email address from the webhook.

    Mapping user data to a webhook

    Simply repeat these steps for each field where you want to use the visitor’s information. Just remember to leave the ‘Password’ field empty, so that Uncanny Automator generates a new password at random.

    By default, Uncanny Automator will create each new user as a subscriber. If you want to give them a different role, then open the ‘Role’ dropdown and choose an option from the list.

    Changing the default user role

    For more on this topic, see our beginner’s guide to WordPress user roles and permissions.

    Finally, you can tell Uncanny Automator what to do if there’s already an account for this username or email address. Since you don’t want to create duplicate accounts, click on the ‘Do nothing’ radio button.

    With that done, click on ‘Save.’

    Avoiding duplicate users in WordPress

    Create a Password Reset Email

    You’re now ready to create the email that Uncanny Automator will send to your users.

    To get started, scroll to the ‘Send an email’ section and find the ‘To’ field. You can now click on its asterisk button and select ‘User email’ from the dropdown menu.

    Adding an email address to an automated workflow

    When that is done, scroll to the ‘Subject’ field.

    Here, you can type in any plain text that you want to show in the subject line. You can also personalize the email subject using tokens that Uncanny Automator will replace with genuine user data.

    Creating a personalized subject line using dynamic tokens

    To insert a token, select the asterisk button and then click to expand the ‘Receive data from a webhook’ section.

    You can now choose the token you want to use, such as the person’s username, first name, or last name. In this way, you can create a personalized subject, which may improve your email open rates.

    How to create a personalized email subject

    When you’re happy with the subject line, it’s time to create the email’s body copy.

    Similar to the subject, you can type plain text directly into the editor, or use tokens to create a personalized message. For example, if you’ve retrieved the user’s first name from the webhook, then you can address them by name.

    How to automatically email users on a website, blog, or online store

    You’ll also need to include a password reset link, so the user can create their own password and keep their account safe.

    To include this link, simply click on the asterisk and start typing ‘User reset password URL.’

    Adding a password reset URL to an automated email

    When the right option shows up, click to add it to the message.

    When you’re happy with how the email is set up, click on the ‘Save’ button.

    Automatically send an email using Uncanny Automator

    With that done, you’re ready to make this automated recipe live.

    Simply scroll up and click on the ‘Draft’ toggle so that it shows ‘Live’ instead.

    Publishing an Uncanny Automator recipe

    Connect Multiple WordPress Websites Using a Webhook

    In the ‘Trigger’ section, find the ‘Webhook URL.’ Just be aware you may need to click to expand this section, in order to see the webhook URL.

    Getting a webhook URL

    The final step is adding this URL to the first recipe you created on your source site. To do this, copy the URL and then switch back to the recipe on your original website.

    In this tab, scroll to the ‘Actions’ section and find the empty ‘Webhook URL’ field. You can then go ahead and paste the URL into this field.

    Connecting multiple websites using a webhook

    As soon as that’s done, the source website is ready to share user login data and information.

    To make everything live, just click on the ‘Draft’ toggle so that it shows ‘Live’ instead.

    Sharing data using a webhook

    At this point, you have two live Uncanny Automator recipes on two separate websites.

    Now, every time someone creates an account on the source website, Uncanny Automator will share their information with the second website. The user will also get an email with a password reset link.

    Do you want to share users and login information with more websites?

    Then simply repeat the steps above to set up Uncanny Automator on more websites. In this way, you can easily share user data with an unlimited number of WordPress blogs, websites, and online marketplaces.

    Making Sure Your WordPress Email Is Being Sent Reliably

    Sometimes, users may not receive your emails as expected. This is because many WordPress hosting companies do not have the mail function configured properly.

    To prevent their servers from abuse, many hosting companies even disable the mail function completely. This can be a big problem, as your users won’t receive information about how to create their passwords and access their accounts.

    Luckily, you can fix this easily by using WP Mail SMTP. This plugin lets you send your WordPress emails through a reliable SMTP platform which is configured specifically to send emails like SendLayer, Gmail, and Outlook.

    For more details, please see our guide on how to fix WordPress not sending email.

    We hope this article helped you learn how to automatically share users and logins between multiple WordPress sites. You may also want to check out our guide on how to create a file upload form in WordPress, or see our expert picks for the best membership plugins.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Share Users and Logins Between Multiple WordPress Sites first appeared on WPBeginner.

  • How to Properly Configure Your WordPress Email Settings

    Are you wondering how to configure your WordPress email settings?

    The default WordPress email settings are not always reliable and can lead to many sending errors and email delivery problems. This means that you and your customers may not receive emails sent from your WordPress website.

    In this article, we will show you how to properly configure your WordPress email settings.

    Properly configure your WordPress email settings

    Why Do WordPress Email Settings Not Work Properly?

    The default email settings on your WordPress website use the PHP mail () function to send emails about form submissions, account activation, and more.

    However, your website may experience email delivery problems if your hosting provider’s mail server is not properly configured. Plus, many popular email services like Gmail can flag these messages as spam.

    This means that when an email is sent from your website to your user, it may end up in the spam folder of their email account, or it may never reach their inbox at all.

    Luckily, you can get past this problem by properly configuring your WordPress email settings. To do this, you will need to use an SMTP service or plugin.

    What Is SMTP, And How Can It Fix Email Settings in WordPress?

    SMTP (Simple Mail Transfer Protocol) is a standard protocol for mail transmission. Unlike the PHP mail () function, SMTP uses proper authentication to send and receive email messages.

    By using an SMTP service on your website, you can get high deliverability rates, avoid the spam folder, and make sure that your emails reach the user’s inbox immediately.

    To properly configure your WordPress email settings, you will need to use a popular SMTP service provider like SendLayer, Brevo (formerly Sendinblue), or SMTP.com. These service providers are easy to use and allow you to safely send emails from your WordPress site.

    Once you have chosen a service provider, you will have to connect your WordPress website to your mail server.

    This is where the WP Mail SMTP plugin comes in.

    It is the best WordPress SMTP plugin on the market that allows you to send emails via SMTP. It comes with powerful features like email logs, email controls, priority support, and more.

    The premium version of the plugin can even integrate with popular SMTP service providers like SendLayer and Brevo and any WordPress hosting company that offers email accounts.

    Having said that, let’s see how to properly configure your WordPress email settings.

    How to Properly Configure Your WordPress Email Settings

    It is super easy to configure your WordPress email settings using the WP Mail SMTP plugin and an SMTP service provider.

    For this tutorial, we will be using SendLayer, which is the best SMTP service provider on the market.

    Step 1: Create an Account with SendLayer

    First, you need to visit the SendLayer website and click the ‘Get Started With SendLayer’ button.

    Click Get Started with SendLayer button

    This will take you to the Pricing page, where you can select a plan that suits your needs.

    However, if you don’t want to buy SendLayer yet, then you can click on the ‘Try our SendLayer free trial (send up to 200 emails)’ link at the bottom.

    Click on the link to start free SendLayer trial

    This will take you to the ‘Checkout’ page, where you will have to provide your email account, password, and payment details.

    Once your account sign-up has been created, just click the ‘Continue to Dashboard’ button.

    Click Continue to dashboard button

    Step 2: Add Your Domain For Authorization

    Next, you will need to authorize your domain name to allow email servers to recognize you as a verified sender.

    This means that the email sent from your account after authorization won’t end up in the spam folder of your users.

    To do this, click the ‘Add Domain’ button in the top right corner of the screen.

    Click Add Domain button

    This will open up a new page on your screen where you need to type your website domain name into the field.

    Once you’ve done that, just click the ‘Add Domain’ button.

    Add your domain name to connect it with SendLayer

    SendLayer will now automatically generate five types of DNS records for your domain.

    Now, you have to copy and paste these records into your website’s DNS settings one by one.

    To find these DNS settings, you must go to the WordPress hosting account dashboard for your website. The exact location of the DNS settings will depend on your hosting provider, but SendLayer provides some documentation to help you out.

    Add DNS records

    Upon adding all of the DNS records in your hosting dashboard, simply check the ‘I have added these DNS records and am ready to proceed’ box at the bottom of the SendLayer page.

    After that, click the ‘Verify DNS Records’ button to continue.

    Click the Verify DNS Records button

    Keep in mind that it can take up to 48 hours for the DNS record changes to take effect.

    To check your domain authorization status, head over to your SendLayer dashboard and click the ‘Settings’ tab in the left column.

    Once you are on the Settings page, switch to the ‘DNS Records & Settings’ tab from the top.

    If your DNS settings have been verified, you will now see a green symbol in the Status column for each type of DNS record.

    Check DNS records status

    Step 3: Copy the SendLayer API Key

    Now that you have authorized your domain name, it’s time for you to copy the API key for your SendLayer account. This API key will allow you to connect the SMTP service with your WordPress website.

    To do this, click on the ‘Settings’ tab in the left column of your SendLayer dashboard. Next, switch to the ‘API Keys’ tab from the top of the page.

    Once you are there, click the ‘Show API Key’ link and then copy the key into your clipboard.

    Copy the SendLayer API key

    Step 4: Set Up the WP Mail SMTP Plugin on Your WordPress Website

    Once you have created a SendLayer account and copied the API key, head over to your WordPress website’s dashboard.

    Next, you need to install and activate the WP Mail SMTP plugin. For detailed instructions, you may want to see our beginner’s guide on how to install a WordPress plugin.

    Note: Keep in mind that you will need the pro version of the WP Mail SMTP plugin to connect it with your SendLayer account.

    Upon activation, you need to head over to the WP Mail SMTP » Settings page from the WordPress admin sidebar.

    Once you are there, add the license key for your plugin next to the ‘License Key’ option. You can find this information on your account page on the WP Mail SMTP website.

    Type your WP Mail SMTP license key into the field

    After that, scroll down to the ‘From Email’ section and add the admin email that you want to use to send emails to your users.

    If you want the From Email to be the same across your entire site, then simply check the ‘Force From Email’ box.

    After that, type the name that you want to use to send emails next to the ‘From Name’ field.

    For example, if you have an online store, then you can use your store’s name in this field. This way, users will immediately know who is sending them a message.

    For detailed instructions, you may want to see our tutorial on how to set up WP Mail SMTP with any host.

    Add from email and from name into the fields

    After that, scroll down to the ‘Mailer’ section and choose the SMTP service that you want to connect with your WordPress site.

    For this tutorial, we will be choosing the ‘SendLayer’ option.

    Choose SendLayer as the mailer

    Once you do that, a new ‘SendLayer’ tab will open up on the screen.

    Here, you have to paste the API key that you copied earlier from the SendLayer dashboard. If you were unable to copy the key before, then you can just click the ‘Get API Key’ link to be directed back to your SendLayer account.

    Add the SendLayer API key

    Once you are done, simply click the ‘Save Settings’ button to store your changes.

    You have now successfully connected WP Mail SMTP with SendLayer.

    Step 5: Send a Test Email

    To check if your SMTP service provider and the plugin are working properly, you can easily send a test email.

    To do this, switch to the ‘Email Test’ tab from the top of the WP Mail SMTP settings page.

    Once you are there, simply add an email account that you have access to in the ‘Send To’ field. After that, go ahead and click the ‘Send Email’ button.

    Send test email

    Once the email has been sent, you will see a success message on your screen.

    Next, check the inbox for that email address where you will see the test email that you just sent.

    Test email preview

    WP Mail SMTP and SendLayer will now eliminate your email deliverability problems by making sure that your emails are sent to your users’ inboxes and don’t end up in the spam folder.

    Next Steps: How to Grow Your Email List

    Now that you have properly configured your WordPress email settings, it’s time for you to start growing your email list.

    Building an email list is extremely important as email marketing is a cost-effective way to bring back your customers and increase conversions.

    To do this, you can create popups using OptinMonster that will be displayed on your website as targeted email signup forms.

    Similarly, you can also build a lead magnet page, create an email newsletter, or offer content upgrades. For more detailed tips, you may want to see our beginner’s guide on tested and easy ways to build your email list.

    You can also host giveaway contests using RafflePress which is the best giveaway plugin on the market.

    This way, users that are interested will have to sign up on your website to enter the giveaway which will help build your email list. For details, you may want to see our tutorial on how to run a successful giveaway/contest in WordPress.

    We hope this article helped you learn how to properly configure your WordPress email settings. You may also want to see our tutorial on how to use a free SMTP server to send WordPress emails and our expert picks for the best email marketing services for small businesses.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Properly Configure Your WordPress Email Settings first appeared on WPBeginner.

  • How to Connect Microsoft Outlook to WordPress (Step by Step)

    Are you looking for a way to connect Microsoft Outlook to WordPress and send emails from your WordPress site?

    Connecting Microsoft Outlook with WordPress helps improve email deliverability by making sure that your emails reach your subscribers’ inboxes, even if you are sending a lot of them.

    In this article, we will show you how to connect Microsoft Outlook to WordPress, step by step.

    Connect Microsoft Outlook to WordPress

    Why Use Microsoft Outlook to Send WordPress Emails?

    Microsoft Outlook is a great option for business owners who regularly use Office 365.

    You can use your existing Microsoft Outlook account to send emails to your subscribers from your WordPress website.

    The best thing about using Outlook is that it allows you to send a lot of emails at once. You can send up to 10,000 emails per day, which is a much higher limit than other mailing services.

    If you have a busy online store, this will help you send receipts, tracking info, and abandoned cart emails to all your customers.

    Another benefit that Microsoft Outlook provides is that you don’t have to use the default WordPress PHP mail() function to send emails.

    There are many issues with the default mailing method. Plus, many WordPress hosting services don’t have PHP mail properly configured, which leads to email deliverability problems.

    Your emails can end up in the spam folder because email service providers like Gmail can’t detect the email sender.

    However, you can easily overcome this issue using an SMTP service provider to send emails in WordPress through your Outlook account.

    What Is SMTP?

    SMTP, or Simple Mail Transfer Protocol, is an industry-standard technology for sending emails.

    It uses proper authentication, ensuring that your emails reach your users’ inboxes and don’t end up in the spam folder.

    To send your emails, you can connect popular services like SendLayer, SMTP.com, Brevo (Previously Sendinblue), Office 365 / Outlook, Gmail, Amazon SES, and more.

    That being said, let’s see how you can connect your Microsoft Outlook account to WordPress.

    Video Tutorial

    If you prefer written instructions, just keep reading.

    How to Connect Outlook to Your WordPress Site

    The easiest way to add Microsoft Outlook to WordPress is by using the WP Mail SMTP plugin. It lets you securely use the Microsoft API to authenticate your site’s emails.

    WP Mail SMTP

    We will use the WP Mail SMTP Pro version for this tutorial because it includes an Office 365 / Outlook.com integration.

    There is also a free version of WP Mail SMTP with multiple integrations, but it doesn’t let you connect your Outlook account with WordPress.

    Set Up WP Mail SMTP

    First, you will need to install and activate the WP Mail SMTP plugin on your WordPress website. You can refer to our step-by-step guide on how to install a WordPress plugin.

    Note: It’s important to remember that the Outlook mailer will only work if you have an SSL certificate on your website. You can check out our guide on how to set up SSL on a WordPress site.

    Upon activation, you can connect your Outlook account by going to WP Mail SMTP » Settings from your WordPress admin area.

    On the settings page, you will see the ‘From Email’ and ‘From Name’ settings. You can skip these settings because your Outlook account’s settings will override them.

    From Email and Name in WP Mail SMTP settings

    Below that, you will see different options next to the Mailer settings.

    Go ahead and select ‘Outlook’ as your Mailer option.

    Select the Outlook Mailer Option

    Next, WP Mail SMTP will show a new section with settings for your Outlook account.

    It will look like this.

    Outlook Settings in WP Mail SMTP

    To find the Application ID, Application Password, and Redirect URI, you must create a web application within a Microsoft Azure account. Don’t worry; we will walk you through how to do this step by step.

    We recommend keeping the WP Mail SMTP Outlook settings open in a separate tab or window, as you will need to return to this page to enter the information.

    You can use your existing Microsoft email account (Live, Outlook, Hotmail, Office 365, etc.) to log in to Microsoft Azure. Keep in mind that if you do so, then all your WordPress emails will be sent from that email address.

    If you don’t have a Microsoft Outlook account or prefer to send messages from a different email address, you can go to the Microsoft Azure website and create your account. Just make sure that the account you create includes the permissions to send emails.

    The account is free to create, and you don’t need any paid services to set up the mailer. However, Microsoft will ask you to enter your credit card information to reduce spam signups.

    After that, you can log in to the Microsoft Azure Portal using the email address you want to use.

    Create an Application ID

    Once you have opened the Azure Portal, go ahead and click the ‘All services’ option from the sidebar on your left.

    Click All Services option in Azure Portal

    On the next screen, you will see different services offered by Microsoft Azure.

    You can scroll down to the ‘Identity’ section and click on the ‘App registrations’ option.

    Select App Registrations

    After that, you will need to click the ‘+ New Registration’ button.

    This will create your application.

    Create a new registration

    Now, you need to enter a name for your application. This is for your own use, so you can change the name whenever you want.

    For example, you can name it something like ‘WP Mail SMTP: yourdomain.com.’

    As for the ‘Supported account types’ section below, it is a best practice to select the ‘Accounts in any organizational directory (Any Azure AD directory – Multitenant) and personal Microsoft accounts (for example, Skype, Xbox)’ option.

    However, if you don’t see this option in your account types, then you can also select the ‘Accounts in any organizational directory (Any Azure AD directory – Multitenant)’ option.

    Enter a name and select supported account types

    After that, scroll down to the Redirect URI settings.

    You can leave the dropdown settings to ‘Web’ for the first field in the form.

    Keep Redirect Settings to Web

    For the second field, you will need to enter the redirect URI address given in the WP Mail SMTP Outlook settings.

    To find the Redirect URI, simply return to the WP Mail SMTP settings tab or window from your browser. Then copy the web address that is given in the ‘Redirect URI’ field.

    Copy the Redirect URI

    You must paste the URL into the Microsoft Azure app registration form.

    Next, just click the ‘Register’ button.

    Redirect URI Settings

    Microsoft Azure will now take you to another screen where you will see the Application (client) ID.

    Simply click the ‘copy’ icon to copy your application ID.

    Copy the Application ID

    After that, you can enter the application ID into the WP Mail SMTP settings.

    To do that, you need to head over to your WP Mail SMTP settings window and paste the value into the ‘Application ID’ field.

    Paste the copied Application ID in WP Mail SMTP settings

    Create an Application Password

    Once you have entered the application ID, the next thing you need to do is create an application password.

    You can start by clicking the ‘Certificates & secrets’ option in the sidebar on your left.

    Click the Certificates and Secrets option

    On the next screen, you can skip the Certificates section and scroll down to the Client Secrets section.

    Then, just click the ‘+ New client secret’ option to add a client secret.

    Select the New client secret option

    You will now see a new overlay window slide in from the right. In this window, you can enter a description and select a time period for the app password to expire.

    Microsoft Azure lets you select a preset expiry time (3 months, 6 months (recommended), 12 months, 18 months, and so on), or you can set a custom timeframe.

    We recommend selecting one of the preset settings when you are first starting out. You can always change the password expiry time to custom settings in the future.

    Enter a description and set password expiry time

    When you are happy with the settings, just click the ‘Add’ button.

    Then, Microsoft Azure will generate an application password. You can click the ‘Copy to clipboard’ trigger to copy the password under the Value column.

    Copy the application password under the Value column

    Next, you will need to enter this password in your WP Mail SMTP settings.

    To do that, return to the WP Mail SMTP settings and then paste the password into the ‘Application Password’ field.

    Paste the value in the Application Password field

    Set Up API Permissions

    After setting up the Application ID and Application Password in WP Mail SMTP, the next step is to add API permissions.

    To get started, you can click on the ‘API permissions’ option from the menu on your left.

    Click the Api Permissions option

    Next, go ahead and click the ‘Add a permission’ button.

    You will find it in the top-left corner.

    Select the Add a permission option

    When you click the button, a new window will slide in from the right to request API permissions.

    You will have to select the ‘Microsoft Graph’ option to set up API permissions.

    Select the Microsoft Graph option

    On the next screen, Microsoft Azure will ask what type of permissions your application requires.

    You can select the ‘Delegated permissions’ option.

    Select delegate permissions

    Next, you will see multiple options to select permissions.

    However, an easier way to find the right settings is by entering the term ‘send’ in the search bar under the ‘Select permissions’ heading.

    After that, you will have to select the ‘Mail’ tab from the options that appear and then click the checkbox for ‘Mail.Send.Shared’.

    Search send in the search bar and go to the Mail tab

    When you are ready, simply click the ‘Add permissions’ button at the bottom.

    You will have to repeat the API permission steps by clicking on the ‘+ Add a permission’ button and selecting ‘Microsoft Graph’. However, this time, you need to select the ‘Application permissions’ option.

    Select application permissions

    Now, you can enter the same search term, ‘send’, in the ‘Select permissions’ search bar.

    When you see the Mail tab, click on it and then select the checkbox for ‘Mail.Send’.

    Search for send and select mail send option

    Next, go ahead and click the ‘Add permissions’ button.

    After setting up the API permissions, you will have to go back to the WP Mail SMTP settings and click on the ‘Save Settings’ button to finish the Outlook mailer configuration.

    Save settings in WP Mail SMTP

    When you save the settings, you will have to scroll down to the Authorization section in the WP Mail SMTP settings.

    Then, click the ‘Allow plugin to send emails using your Microsoft account’ button.

    Allow the plugin to send emails using your Microsoft account

    As soon as you click on the button, you will be redirected to the Microsoft permissions form.

    All you have to do is click the ‘Yes’ button at the bottom. This will allow WP Mail SMTP to connect to your Microsoft account.

    Give permission to connect to your Microsoft account

    After that, you will be redirected back to the WP Mail SMTP settings page.

    A notice will appear at the top showing that you are ready to send emails through Outlook.

    Notice for successfully adding Microsoft API

    You can now send a test email to check if everything works properly.

    To send a test email, simply go to WP Mail SMTP » Settings and then click on the ‘Email Test’ tab at the top.

    When you are happy with the settings, just click the ‘Send Email’ button at the bottom.

    Go to the Email Test tab

    After sending the email, you must go to your inbox.

    Here, you can check whether you received the test email.

    Test email from WP Mail SMTP

    We hope this article helped you learn how to connect Microsoft Outlook to WordPress. You may also want to check out our comparison of the best email marketing services for small businesses and our complete guide on how to add web push notifications in WordPress.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Connect Microsoft Outlook to WordPress (Step by Step) first appeared on WPBeginner.

  • How to Setup WordPress Email Logs (and WooCommerce Email Logs)

    Do you want to set up email logs on your WordPress or WooCommerce website?

    Email logs allow you to monitor the emails sent by your WordPress site to users. This helps you troubleshoot issues and check the status of email notifications.

    In this article, we will show you how to set up WordPress email logs and WooCommerce email logs easily.

    How to set up email logs in WordPress and WooCommerce

    After following this tutorial, you will be able to view the email logs directly from your WordPress admin area in an easy-to-understand format.

    Why Set Up Email Logs in WordPress or WooCommerce?

    Whether you are running a small business website using WordPress or a WooCommerce store, WordPress automatically sends some email notifications to your users.

    On a typical WordPress website, these messages include password reset emails, new user notifications, password change notifications, comments, and WordPress update notifications.

    If you are also running an online store, then email becomes even more important. WooCommerce will send out customer receipts, order details, new order notifications, and user account emails regularly.

    As you can see, email notifications are crucial for your website to function properly and deliver the best user experience.

    You need to make sure that those emails reach users’ inboxes and don’t just disappear or end up in spam. The best way to do this is to use a proper SMTP service provider to ensure email deliverability.

    For more details, see our guide on how to fix the WordPress not sending email issue.

    You will also want to see which emails are sent and to which users. This allows you to keep a record of email activity, which comes in handy in several situations.

    Following are just a few of those situations when an email log comes in handy:

    • Make sure that email notifications are delivered promptly.
    • Track your WordPress contact form plugin emails.
    • See if emails sent by a plugin are working.
    • Keep track of user activity using the email logs.
    • Track user activity if you run a membership website or sell online courses.
    • Keep an email log of your WooCommerce orders, receipts, and customer notifications.

    That being said, let’s see how to easily set up email logs on your WordPress or WooCommerce website.

    Video Tutorial

    If you prefer written instructions, just keep reading.

    Setting Up Email Logs in WordPress & WooCommerce

    For this tutorial, we will be using the WP Mail SMTP plugin. It allows you to send WordPress emails using any SMTP service provider, including Gmail, Outlook, SendGrid, Amazon SES, and more.

    How WP Mail SMTP works

    Step 1: Install and Set Up WP Mail SMTP

    The first thing you need to do is install and activate the WP Mail SMTP plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Upon activation, you need to visit the WP Mail SMTP » Settings page to configure the plugin’s settings.

    First, you will need to enter your license key. You can find this information in your account on the WP Mail SMTP website.

    WP Mail SMTP license key

    Simply copy and paste your license key and then click on the ‘Verify’ button.

    After that, you need to scroll down to the Mailer section and select how you would like to send your WordPress emails.

    WP Mail SMTP works with any SMTP service. It has easy configuration options for popular SMTP service providers like SendLayer, SMTP.com, Gmail, Outlook, Brevo (Previously Sendinblue), Mailgun, SendGrid, Amazon SES, and other SMTP services.

    Select mailer

    Clicking on the mailer will show you instructions on how to set it up.

    The default option is set to PHP mailer. We don’t recommend using that because it is not reliable.

    Since most WordPress hosting servers are not properly configured for emails, choosing this option means that your WordPress emails may never reach users’ inboxes or even spam folders.

    We recommend using a provider like SendLayer, SMTP.com, or Brevo (Previously Sendinblue) since they are optimized for the best email deliverability.

    If you choose Other SMTP as your mailer option, then you will need to provide SMTP settings. You can get them from your SMTP service provider’s website:

    • SMTP Host: Your SMTP host address, which usually looks like this: smtp.yoursmtpserver.com
    • Encryption: Usually, it is either SSL or TLS
    • SMTP Port: Usually, it is 465
    • Authentication: Turn on the authentication
    • Username: The username provided by your SMTP service. Usually, it is your email address
    • Password: The password for your SMTP service
    Other SMTP service provider

    After entering your mailer credentials, don’t forget to click on the ‘Save Settings’ button to store your settings.

    Bonus: It’s important to use a professional business email address to make sure that your emails look trustworthy.

    Step 2: Enable the Email Log Feature

    Now that you have set up mailer settings in the WP Mail SMTP plugin, it is time to turn on the email logging feature.

    From the plugin’s settings page, you need to switch to the ‘Email Log’ tab and check the box next to the ‘Enable log’ option.

    Turn on email logs

    The email log option will save general and troubleshooting information about each email message, including the date and time, subject, email status, email addresses of the sender and recipient, BCC and CC, and attachments.

    The plugin also allows you to enable complete WordPress email logs. We don’t recommend enabling this setting because it will save all email contents, including private or sensitive information in your WordPress database, as plain text.

    Don’t forget to click on the ‘Save settings’ button to save your changes.

    Step 3: Testing WP Mail SMTP Setup

    Now that you have set up the WP Mail SMTP plugin, let’s test it to make sure that everything is working as expected.

    WP Mail SMTP makes this step easy. Just go to the WP Mail SMTP » Settings page and switch to the ‘Email Test’ tab.

    Test WordPress SMTP email settings

    From here, simply enter your email address and click on the ‘Send Email’ button.

    The plugin will now send a test email to the address you provided. It will then show you the status of the email delivery on the screen.

    Email sent successfully

    Step 4: Viewing Your Email Logs in WordPress

    You can view your WordPress email logs anytime without leaving the WordPress admin area.

    Simply go to the WP Mail SMTP » Email Log page. You will see the log with a list of entries from since you enabled the email log.

    Email log entries

    To view entry details, take your mouse over it and then click on the ‘View’ link below it.

    This will open the email log entry with a detailed view.

    Email log entry

    You can use the search feature to look for entries by email address, subject, header, or content (if you enabled content logging).

    You can also delete older entries from your email log. Simply use the ‘Delete’ link below any entry.

    To delete multiple entries, you need to select each email and then click on the ‘Bulk actions’ dropdown menu to select ‘Delete’.

    After that, you must click on the ‘Apply’ button.

    Delete email log entries in WordPress

    If you need to analyze your email logs more carefully or create your own deliverability reports, then you can export your logs to your favorite spreadsheet software or email marketing service.

    You can also easily resend an email that has failed.

    Export WP Mail SMTP Logs

    WP Mail SMTP Pro subscribers can also visualize their email deliverability in a chart that shows how many emails were sent, opened, and clicked each day.

    This is super useful for WooCommerce users.

    WP Mail SMTP Displays a Graph of Deliverability Over Time

    It’s easy to check the engagement of each campaign or newsletter. The logs include open and click counts for each email subject.

    Clicking the graph button displays a chart of how the specific email is performing.

    WP Mail SMTP Subject Line Report

    And every week, WP Mail SMTP will email you a helpful summary of your email performance statistics.

    It looks something like this.

    WP Mail SMTP Weekly Summary Statistic Email

    We hope this article helped you learn how to set up WordPress email logs and WooCommerce email logs. You may also want to see our guide on how to monitor user activity in WordPress with security audit logs, or check out our list of the must-have plugins to grow your site.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Setup WordPress Email Logs (and WooCommerce Email Logs) first appeared on WPBeginner.

  • How to Set Up WP Mail SMTP with Any Host (Ultimate Guide)

    Do you want to set up WP Mail SMTP on your WordPress site?

    WP Mail SMTP is the best WordPress SMTP plugin that allows you to easily send WordPress emails using a secure mail transfer protocol (SMTP). It makes sure your emails go to the inboxes of your users and not to the spam folder.

    In this article, we will show you how to easily set up WP Mail SMTP with any host or third-party SMTP service.

    Setting up WP Mail SMTP with any WordPress host

    This is a lengthy article, so we have added a table of contents. If you know what you are looking for, then you can click the link to jump to that section:

    What Is WP Mail SMTP, and Why Do You Need It to Send WordPress Emails?

    WP Mail SMTP is the best WordPress SMTP plugin on the market. It allows you to send all your WordPress emails using an SMTP server.

    Once you set up your WordPress site, you may notice that you are not getting any emails from WordPress. These include WordPress notification emails and emails from your WordPress contact form plugin.

    The reason you are not getting emails is usually that WordPress uses the PHP mail() function to send them.

    Most WordPress hosting companies do not configure this function properly, and some simply disable it to prevent abuse.

    The easiest fix for this issue is to use SMTP to send WordPress emails.

    SMTP stands for ‘secure mail transfer protocol’, and it is pretty much the standard way to send emails. It requires you to log in to a mail server to send emails. This prevents the abuse of the hosting server and improves email deliverability, which means that you and your users will receive all WordPress emails.

    Hosting SMTP Server vs. Third-Party SMTP Server – Which One Should You Use?

    Most WordPress hosting companies offer free business email addresses that you can use with your own domain name.

    We recommend setting up a separate email address for your WordPress website. It can be anything like support@example.com or info@example.com.

    However, your WordPress hosting provider does not specialize in sending emails. Their SMTP servers are basic and have strict limits on the number of emails you can send.

    If you run a small business website or a blog, then you will probably be fine with your hosting provider’s SMTP servers.

    On the other hand, if you run an online store or a membership website, then emails become mission-critical for your business. You want to make sure that your customers get important email notifications delivered to their inboxes.

    This is where you need a third-party SMTP service provider. These companies specialize in securely sending large numbers of emails without triggering spam filters.

    We recommend using SendLayer, Brevo (formerly Sendinblue), or SMTP.com for most online businesses. They are reasonably priced and can scale as your business grows.

    For more information, you can see our article on the top SMTP service providers.

    Once you have chosen an email delivery method, the next step is to connect your WordPress website to your mail server.

    This is where the WP Mail SMTP plugin comes in. It allows you to send WordPress emails via SMTP by entering your SMTP credentials.

    WP Mail SMTP is the most popular SMTP solution for WordPress, currently used by over 3 million websites. It’s maintained by the same team as WPForms.

    There is also a free WP Mail SMTP lite version that is fully functional and can be used with any WordPress hosting company or third-party SMTP service provider.

    The premium version of the WP Mail SMTP plugin supports all the top SMTP service providers and works with any WordPress hosting company that offers email accounts.

    It also comes with powerful features like email logs, email controls, priority support, and a white glove setup.

    Installing and Setting Up WP Mail SMTP

    The first thing you need to do is install and activate the WP Mail SMTP plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Upon activation, you will see the setup wizard. You can skip it as we will show you how to set up WP Mail SMTP manually.

    WP Mail SMTP Launch Wizard

    Just click on ‘Go back to the Dashboard’.

    Next, you need to visit the WP Mail SMTP » Settings page to configure the plugin settings.

    WP Mail SMTP Settings

    You need to enter your SMTP settings to use WP Mail SMTP. The first part of the settings will be similar regardless of your hosting company. It includes the following fields:

    • From Email – This email address will be used to send all WordPress emails.
    • From Name – This name will be used to send emails. We recommend using your website’s title.
    • Return Path – Check this box to receive delivery notifications or bounced messages.
    • Mailer – You need to select ‘Other SMTP’ here as you will be sending emails using your host’s SMTP server

    Note: If you want to use third-party mailers, follow this guide to send WordPress emails via Gmail SMTP. We also have a similar guide for the Brevo (formerly Sendinblue) SMTP setup.

    WP Mail SMTP return path and mailer settings

    If you want to continue using your host, you need to select ‘Other SMTP’ and enter the SMTP server settings provided by the hosting company.

    • SMTP Host – The SMTP host address provided by your hosting company.
    • Encryption – The encryption method used by your mail server to send emails. Usually, it is TLS.
    • SMTP Port – The port used by the outgoing mail server.
    • Auto TLS – This setting should be set to On.
    • Authentication – Needs to be On.
    • SMTP Username – Usually the email address you are using to send emails.
    • SMTP Password – The password for the email account you are using to send emails. We don’t recommend saving SMTP passwords here. Instead, you need to store your password in the wp-config.php file.
    Other SMTP

    These settings are required to connect with any SMTP server. However, their values may differ from one WordPress hosting company to another.

    Let’s see how to set up the WP Mail SMTP plugin with different hosting companies.

    Setting Up WP Mail SMTP on Bluehost

    Bluehost is one of the biggest hosting companies in the world and an officially recommended WordPress hosting provider.

    We recommend Bluehost to all users who are starting a WordPress blog or making a small business website.

    Here are the SMTP settings you will be using to connect WP Mail SMTP to the Bluehost SMTP server:

    • SMTP Host – mail.example.com
    • Encryption – TLS
    • SMTP Port – 587
    • SMTP Username – Your email address (e.g. wordpress@example.com)
    • SMTP Password – Your email account password

    Don’t forget to replace example.com with your own domain name.

    Bluehost SMTP

    Setting Up WP Mail SMTP on SiteGround

    SiteGround is another popular WordPress hosting company. They offer excellent shared, managed, and WooCommerce hosting services.

    Here are the SMTP settings you will be using to connect WP Mail SMTP with SiteGround servers:

    • SMTP Host – mail.example.com
    • Encryption – TLS
    • SMTP Port – 587
    • SMTP Username – Your email address (e.g. wordpress@example.com)
    • SMTP Password – Your email account password
    SiteGround SMTP

    Setting Up WP Mail SMTP on HostGator

    HostGator is another popular WordPress hosting company. WPBeginner is hosted with HostGator, and we have been using them for over a decade.

    Here are the SMTP settings you will be using to connect WP Mail SMTP with HostGator servers:

    • SMTP Host – full.servername.com
    • Encryption – SSL
    • SMTP Port – 465
    • SMTP Username – Your email address (e.g. wordpress@example.com)
    • SMTP Password – Your email account password
    HostGator SMTP settings for WordPress

    You will notice that instead of using your domain as the SMTP Host, it uses the server name. You can find the server name in your cPanel hosting dashboard.

    Simply log in to your cPanel, and you will see the full server name in the right column towards the bottom.

    HostGator server hostname

    Setting Up WP Mail SMTP on DreamHost

    DreamHost is a popular WordPress hosting company. They have been around since 1997 (way before WordPress, Google, or Facebook) and offer shared WordPress hosting, managed, and VPS hosting plans.

    Here are the SMTP settings you will be using to connect WP Mail SMTP with DreamHost servers:

    • SMTP Host – full.servername.com
    • Encryption – SSL
    • SMTP Port – 465
    • SMTP Username – Your email address (e.g. wordpress@example.com)
    • SMTP Password – Your email account password
    DreamHost SMTP

    You will notice that Dreamhost doesn’t use your domain name as the mail server. Instead, they use different servers to manage emails, and you will need to find out which one is used by your hosting account.

    You can do this by logging in to your DreamHost hosting panel and then going to the Support » Data Centers page. From here, you need to scroll down to the Mail service section.

    DreamHost Mail Service

    You will find the name of the email cluster under the Details column next to your domain name.

    Next, you need to visit DreamHost’s email configuration page and scroll down to the ‘Where to find your mail hostname (cluster) name’ section.

    Here, you can match your email cluster with the names in the table and copy the outgoing server address next to it.

    SMTP server DreamHost

    Setting Up WP Mail SMTP on InMotion Hosting

    Here are the SMTP settings you will be using to connect WP Mail SMTP with InMotion Hosting servers:

    • SMTP Host – server##.inmotionhosting.com
    • Encryption – SSL
    • SMTP Port – 465
    • SMTP Username – Your email address (e.g. wordpress@example.com)
    • SMTP Password – Your email account password
    InMotion Hosting SMTP settings for WordPress

    In the SMTP host field, you need to replace ## with your server number.

    You can find this by logging in to your cPanel dashboard and then clicking on the ‘Account Technical Details’ icon.

    Finding your InMotion Hosting server number

    Setting Up WP Mail SMTP on GoDaddy

    GoDaddy is the world’s most popular domain name registrar, managing more than 76 million domain names for over 17.5 million customers. They also offer different hosting plans (For details, see our article on the difference between a domain name and web hosting).

    Here are the SMTP settings you will be using to connect WP Mail SMTP with GoDaddy shared hosting plans:

    • SMTP Host – mail.example.com
    • Encryption – TLS
    • SMTP Port – 587
    • SMTP Username – Your email address (e.g. wordpress@example.com)
    • SMTP Password – Your email account password
    GoDaddy SMTP settings for WP Mail SMTP

    Setting Up WP Mail SMTP on iPage

    Here are the SMTP settings you will be using to connect WP Mail SMTP with iPage hosting servers:

    • SMTP Host – smtp.ipage.com
    • Encryption – TLS
    • SMTP Port – 587
    • SMTP Username – Your email address (e.g. wordpress@example.com)
    • SMTP Password – Your email account password
    iPage SMTP settings for WP Mail SMTP

    Setting Up WP Mail SMTP on GreenGeeks

    Here are the SMTP settings you will be using to connect WP Mail SMTP with GreenGeeks:

    • SMTP Host – mail.example.com
    • Encryption – SSL
    • SMTP Port – 465
    • SMTP Username – Your email address (e.g. wordpress@example.com)
    • SMTP Password – Your email account password
    GreenGeeks SMTP settings for WP Mail SMTP

    Setting Up WP Mail SMTP on JustHost

    Here are the SMTP settings you will be using to connect WP Mail SMTP with JustHost:

    • SMTP Host – mail.example.com
    • Encryption – SSL
    • SMTP Port – 465
    • SMTP Username – Your email address (e.g. wordpress@example.com)
    • SMTP Password – Your email account password
    JustHost SMTP settings for WP Mail SMTP

    Setting Up WP Mail SMTP With Third-Party Email Services

    Some managed WordPress hosting companies do not offer email services as part of their hosting plans. So, you will need to use a third-party SMTP service provider to send emails.

    WP Mail SMTP supports multiple popular mailing services, including SendLayer, Gmail/Google Apps for Work, Microsoft Outlook and Office 360, Brevo (formerly Sendinblue), SMTP.com, and more.

    Simply click on the mailer service, and the plugin will show you the information required to use that mailer.

    Mailers in WP Mail SMTP

    For details, you can see our tutorial on how to use a free SMTP server to send WordPress emails.

    We hope this article helped you learn how to set up WP Mail SMTP with any host. You may also want to see our guide on why you should never use WordPress to send your newsletter emails and our expert picks for the best newsletter plugins.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Set Up WP Mail SMTP with Any Host (Ultimate Guide) first appeared on WPBeginner.

  • How to Get Email Notification for Post Changes in WordPress

    Do you want to get email notifications for post changes in WordPress?

    By default, WordPress doesn’t send notifications when posts are changed by a user. If you run a multi-author WordPress site, then you may want to stay informed about post changes on your website.

    In this article, we will show how to get email notifications for post changes in WordPress.

    How to Get Email Notification for Post Changes in WordPress

    Why Set Up Email Notifications for Post Changes in WordPress?

    If you’re the only one working on your own WordPress website, then it is easier to keep an eye on everything that is happening on your website.

    However, if you have other authors writing blog posts, or SEO specialists optimizing blog posts for SEO, then you may want to keep an eye on the changes they make.

    For instance, you may want to be alerted when a new post is published or if changes were made to an older article.

    This also helps all team members be accountable. If they make a mistake, then it can be easily caught and remedied quickly.

    That said, let’s take a look at how to get email notifications for post changes in WordPress. We’ll cover two methods so you can choose one that works best for you. We’ll also show you how to undo post changes and make sure your notification emails are delivered.

    Method 1: Getting Notifications for Post Changes Using WP Activity Log

    This method is recommended for all users as it is easy, powerful, and flexible.

    The first thing you need to do is install and activate the WP Activity Log plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Upon activation, you’ll be asked to enter your license key. You can find this information under your account on the WP Activity Log website.

    Add license key for WP Activity Log

    Next, you’ll be given the option to run the setup wizard. You can answer a few quick questions to set up important monitoring and logging features.

    All these things can be changed later in plugin settings too.

    WP Activity Log setup wizard

    Setting Up Email Notifications for Post Changes in WordPress

    After that, you need to visit the WP Activity Log » Email & SMS Notifications page and switch to the ‘Content Changes’ tab.

    Installing the Helper Plugin in WP Activity Log

    You will see a message that a helper plugin is needed to enable SMS notifications.

    If you want to receive SMS notifications as well as email notifications, then simply click the button labeled ‘Install the helper plugin’. You will finish setting up SMS notifications in the next step.

    Now you need to select the events that will trigger notifications. The plugin comes with three default notifications covering most content changes.

    Setting up content change notifications in WP Activity Log

    Next to each event, you need to enter the email address the notifications should be sent to. In the next step, you will also add a mobile phone number if you want to get SMS notifications for post changes.

    Finally, click on the ‘Save Notifications’ button to store your changes.

    Setting Up SMS Notifications for Post Changes in WordPress

    WP Activity Log allows you to easily receive SMS notifications for post changes and other WordPress activities. To do that, you’ll need a Twilio account and a phone number.

    Twillio is a paid service with a pay-as-you-go pricing model for SMS messages. Pricing starts at $0.0079 per SMS, and you’ll also need to purchase a virtual phone number which will be used to send messages.

    Simply go to the Twilio website and signup for a free trial account.

    Sign up for a Twilio account

    After setting up your account, you’ll reach the Twilio Console.

    Here, you can copy your Account SID, Auth Token, and get a trial phone number.

    Getting your Twilio credentials

    Copy and paste these values to a text editor or leave this browser tab open.

    Next, you need to switch back to your WordPress website admin area and visit the WP Activity Log » Settings page. From here, switch to the SMS Provider tab and enter your Twilio Account SID, Auth token, and number.

    Entering your Twilio credentials

    Don’t forget to click on the ‘Save Changes’ button to store your settings.

    Now you can navigate back to WP Activity Log » Email & SMS Notifications and switch back to the ‘Content Changes’ tab. Here you can add a mobile phone number to get SMS notifications for post changes.

    Entering the Phone Number for SMS Notifications

    Testing Post Change Notifications with WP Activity Log

    WP Activity Log allows you to easily test your post change notifications.

    First, make sure you are on the ‘Content Changes’ tab of the WP Activity Log » Notifications page.

    Test notifications in WordPress Activity Log

    Now you can scroll down and click the ‘Test Notifications’ button.

    This will bring up a popup window where you can enter an email address and a mobile phone number to send notifications.

    Send test notifications

    WP Activity Log will then send test notifications. If you do not receive an email notification right away, then you can jump to the section below on troubleshooting email notifications.

    If you fail to receive SMS notifications, then check your Twilio credentials to make sure they are correct.

    Method 2: Getting Notifications for Post Changes With Better Notifications for WP

    This method is easy to use, but it doesn’t come with ready-made templates. While this method will send an email notification when a post is changed, you will have to write the email yourself and investigate the activity on your own.

    First, you need to install and activate the Customize WordPress Emails and Alerts – Better Notifications for WP plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    Upon activation, you need to visit the Notifications » Add New page to create your first custom notification.

    Creating a post change notification

    First, you need to provide a title for the notification. After that, you can choose a ‘Notification For’ option from the drop-down menu. This is the event that will trigger this notification, such as ‘Post Updated’ in the screenshot above.

    If you like, you can check the ‘Additional Email Fields’ box so you can enter custom email addresses for the sender, cc, and more. If this option is left unchecked, then the plugin will simply use your default WordPress email settings.

    Next, you need to select the users or user roles that will receive this notification under the ‘Send To’ option. Below that you can write the email subject and the message itself.

    Setting up email settings

    The Better Notifications for WP plugin doesn’t come with a template for post changes. This means you’ll need to write your own email message.

    The plugin comes with a bunch of shortcodes that you can use to customize your notifications. You can view all of them by clicking on the ‘Find Shortcodes’ button.

    Lastly, you need to click on the ‘Save’ button to store your email notification. Once you’ve done that, you’ll be able to click on the ‘Send Me a Test Email’ button to see if it is working.

    Save and test your email notification

    Better Notifications for WP is not an activity monitoring plugin. This means you’ll need to set up multiple notifications to cover different types of content changes in WordPress.

    For instance, you may want to set up a ‘Post Published’ notification or another one for when a category or tag is changed.

    The plugin also allows you to create custom notifications or modify default WordPress notifications as well. For more details, see our article on how to create better custom notifications in WordPress.

    Revising and Undoing Post Changes in WordPress

    Once you have received an email notification for post changes, you may want to see what changes were made, who made them, and when.

    WordPress comes with a built-in revision management system that keeps track of all changes made to an article.

    Simply edit the post or page that you want to review and then click on the ‘Revisions’ tab under the ‘Post’ settings from the right column.

    Open revisions for a post or page in WordPress

    This will bring you to the post revisions screen.

    You can check the ‘Compare any two revisions’ box and then move the slider below to compare the changes.

    Comparing revisions in WordPress

    When you scroll down the post, you will see the changes between the two revisions highlighted in red and green colors.

    If you don’t like the changes, then you can simply click on the ‘Restore This Revision’ button to undo them and return to the previous version.

    Changes highlighted in revision history

    For more details, see our guide on how to undo changes in WordPress with post revisions.

    Troubleshooting Email Notifications in WordPress

    By default, WordPress uses the PHP mail() function to send emails. This method does not use proper authentication (login or password) which means it can be easily misused. This is why most spam filters mark such emails as spam or block them altogether.

    To fix this, you need to use a proper SMTP service provider to send out WordPress emails. There are even free SMTP servers like SendLayer, Gmail, Sendinblue, Sendgrid, and more that you can use with WordPress.

    To set up SMTP, you need to install and activate the WP Mail SMTP plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

    WP Mail SMTP allows you to connect your WordPress site to your SMTP service provider and send all your WordPress emails with much higher deliverability.

    Upon activation, you need to go to the WP Mail SMTP » Settings page in your WordPress admin area to set up the plugin.

    WP Mail SMTP license

    First, you need to enter your license key. You can find this information under your account on the WP Mail SMTP website.

    After that, scroll down to the ‘Mailer’ section to select your SMTP service provider. WP Mail SMTP will show all top SMTP service providers. You can click on your provider and then enter the required information below (usually an API key).

    SMTP mailers in WP Mail SMTP

    If your mailer is not listed, then you can simply choose ‘Other SMTP’ option and enter the required information.

    To learn more, see our tutorial on how to fix WordPress not sending email issue.

    We hope this article helped you set up email notifications for post changes in WordPress. You may also want to see our tips on getting more traffic to your blog and the best WordPress SEO plugins and tools to grow your website.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Get Email Notification for Post Changes in WordPress first appeared on WPBeginner.

  • How to Send Automated Coupons in WordPress to Bring Back Customers

    Do you want to send automated coupons in WordPress to bring back customers?

    By sending the right coupon to the right person at the right time, you can re-engage customers who are losing interest. This can get you more sales, create brand loyalty, and help you keep your best customers.

    In this guide, we’ll show you a few different ways to send automated coupons in WordPress, and bring back customers.

    How to send automated coupons in WordPress to bring back customers

    Why Send Automated Coupons to Bring Back Customers?

    You may have heard the saying that it costs five times more to get a new customer than keep an old one.

    While lead generation will help grow your business, you also need to keep your existing customers happy. Over time, people may lose interest in your website, forget about your products, or start shopping with a competitor.

    That’s where automated coupons come in.

    The best WordPress automation tools and plugins can watch your customers for signs they’re becoming disengaged. For example, a customer may not place an order for 2 months or stop opening your emails.

    One way to bring those customers back is to automatically send them a coupon code via email. By creating this automated workflow in WordPress, you can retain customers without having to do all the hard work yourself.

    Pro Tip: If you send coupons via email, then you’ll need to make sure those messages land in the customer’s inbox and not in the spam folder. Here, a good SMTP service provider is essential for improving your email deliverability. We also recommend using WP Mail SMTP as it allows you to easily send WordPress emails using any SMTP service provider.

    With that being said, let’s see how you can send automated coupons in WordPress and bring back customers. Simply use the quick links below to jump to the method you want to use.

    Method 1. Using FunnelKit (Best for WooCommerce Users)

    One way to send automated coupons in WordPress, is by using FunnelKit Automations.

    FunnelKit is a WordPress sales funnel builder and optimization plugin that allows you to create powerful customer winback campaigns. It also lets you create unique, personalized coupons, which can really catch the shopper’s attention.

    FunnelKit integrates with WooCommerce and has lots of features that are designed to grow your online store. With that in mind, FunnelKit is a great choice if you already use WooCommerce to sell products and services online.

    How to Set up the FunnelKit WordPress Plugin

    First, you’ll need to install and activate the free version of FunnelKit Automations, as it provides the base for the premium plugin’s features. For more details, please see our guide on how to install a WordPress plugin.

    After that, you’ll need to install and activate the FunnelKit Automations Pro plugin.

    After activating both plugins, go to FunnelKit Automation » Settings. You can now go ahead and add the license key to the ‘License’ field.

    Adding a license to the FunnelKit Automations WordPress plugin

    You’ll find this information in your account on the FunnelKit website. After adding this information, click on the ‘Activate’ button.

    How to Create an Automated Coupon Workflow for WordPress

    Now, we’re going to create a workflow that will generate a personalized coupon and send it to the customer via email. This workflow will run once 30 days have passed since the customer’s last order.

    To create the workflow, go to FunnelKit Automations » Automations (Next Gen) in the WordPress dashboard. Then, click on the ‘Add New Automation’ button.

    Creating a new WordPress automation with FunnelKit

    You’ll now see all the different automation templates that you can use.

    Since we want to create our own workflow, select ‘Start from Scratch.’

    Creating a custom automated workflow in WordPress

    In the popup that appears, type in a name for the automation. This is just for your reference, so you can use anything you want.

    With that done, click on ‘Create.’

    Add a name to your FunnelKit automation workflow

    Now, we need to choose the action that will kickstart the workflow, so click on ‘Select Trigger.’

    In the left-hand menu, choose ‘WooCommerce’ and then click to select ‘Customer Win Back.’

    Adding a 'customer winback' trigger to an automation workflow

    With that done, click on ‘Done’ to add the trigger to your automation workflow.

    Back in the main editor, click on the ‘Customer Win Back’ trigger.

    Adding a trigger to the FunnelKit automation editor

    In the ‘Customer Last Ordered Period’ section, you can type in how long FunnelKit will wait before running the workflow.

    For example, in the following image the workflow will run when 30 days have passed since the customer’s last order.

    FunnelKit will repeat this automation once every 24 hours, so it’s important to only run it for a short period of time. For this reason, we’ve set the workflow to stop when 35 days have passed since the customer’s last order.

    Adding an order period to the automation recipe

    In this way, you won’t annoy customers by sending them dozens of emails.

    Next, you can set the time when the automation will run, using the ‘Schedule this….’ fields. FunnelKit will use your store’s timezone, so you may want to change your online store settings if you want to use a different timezone instead.

    Scheduling an automated coupon code

    With that done, click on ‘Save.’

    Back in the main workflow editor, click on ‘+’ and then select ‘Action.’

    Adding actions to an automated workflow in WordPress

    In the popup that appears, select ‘WooCommerce’ and then click on ‘Create Coupon.’

    Simply click on ‘Done’ to add this action to the workflow.

    How to create an automated coupon using FunnelKit

    Back in the main FunnelKit editor, click on the action you just added. This opens a popup where you can customize the ‘Create Coupon’ action.

    To start, type a name for the coupon into the ‘Coupon Title’ field. This is just for your reference so you can use anything you want.

    Creating a winback customer automation workflow in WordPress

    After that, choose the type of coupon that you want to create, using the ‘Discount Type’ dropdown menu.

    FunnelKit supports percentage discount, fixed cart discount, and fixed product discount. Most of the time, you’ll want to select ‘Percentage Discount’ to make sure all customers get a similar benefit, no matter how much they spend or what products they buy.

    After that, type an amount into the ‘Amount’ field. For example, you might offer customers 20% off, or a $5 discount on all purchases.

    How to create an automated percentage discount coupon

    FunnelKit automatically creates a unique coupon code for each contact. However, you can add a prefix to the start of the coupon, which can either be plain text or dynamic tags. FunnelKit will replace these tags with real text every time it creates a code, so this is a great way to create personalized coupons.

    Since we want to bring shoppers back in, you may decide to include the customer’s name in the coupon. This can catch their attention, and also makes your code easier to remember.

    To add plain text as a prefix, simply type into the ‘Coupon Code Prefix’ field.

    Adding a prefix to the automated coupon code

    To add one or more tags, click on the ‘Merge tags’ icon.

    This is the button that has curly braces.

    Adding dynamic text to the automated coupon code

    Now, you’ll see all the tags that you can use in the automated coupon.

    We’re going to use the {{contact_first_name}} tag, but you can use any tags you want.

    How to create a personalized coupon code with merge tags

    Simply copy each tag and then paste it into the ‘Coupon Code Prefix’ field.

    As you can see in the following image, you can use a mix of plain text and tags.

    How to create a personalized and dynamic coupon code

    By default, the coupon will never expire. A sense of urgency and FOMO can push customers to use a coupon, so you may want to select the radio button next to ‘Expire after Specific Days’ or ‘Expire on Specific Date.’

    You can then use the controls to specify when the coupon will expire.

    Adding a coupon expiration date to your WordPress coupon

    Finally, you can choose whether the coupon gives customers a free shipping discount.

    Shoppers love free shipping, so you may want to consider adding this to your coupon by selecting the ‘Yes’ radio button under ‘Allow Free Shipping.’

    How to create a free shipping discount for your online store

    When you’re happy with how the coupon is set up, make sure you copy the small pieces of code under the ‘Coupon Title.’

    You’ll need this coupon code for the email we’ll be creating in the next step, so store it somewhere safe.

    Creating an automated coupon to win back customers

    With that done, click on ‘Save’ to store your changes.

    Now we have a coupon, it’s time to create the email that FunnelKit will send to your customers. To add an email action, click on the ‘+’ button and then select ‘Action.’

    Add an email action to win back customers

    If it isn’t already selected, then click on ‘Messaging’ in the left-hand menu.

    Then, select ‘Send Email’ and click on ‘Done.’

    Choosing an action in the FunnelKit automation plugin

    You can now create an email by typing in a subject and preview, and adding body text.

    Similar to creating a coupon, it’s best to use a mix of plain text and tags. To add dynamic tags, click on the ‘Merge Tags’ icons that appear next to the To, Subject, and Preview Text fields.

    How to create a personalized email to win back customers

    If you want to add tags to the email body, then you can click on the ‘Merge Tags’ button.

    To add your coupon code, simply paste or type in the {{wc_dynamic_coupon id= code we copied in the previous step.

    Create a personalized email to bring back customers

    When you’re happy with how the email looks, click on ‘Save & Close.’

    That’s it. When you’re ready to make the automation live, click on the ‘Inactive’ slider so it turns to ‘Active.’

    Making your workflow automation live

    Now, FunnelKit will automatically send the coupon to any customer who hasn’t purchased from you in the past 30 days.

    Method 2. Using Uncanny Automator (Over 100 Integrations)

    Another way to send automated coupons in WordPress, is by using Uncanny Automator. It is one of the best WordPress automation plugins on the market and lets you create powerful workflows to save time and help you respond to customers more quickly.

    Uncanny Automator works seamlessly with WooCommerce, plus all of the must have WordPress plugins and third-party tools. If you’re already using lots of different software on your online store, then Uncanny Automator may be a good choice for you.

    There is a free Uncanny Automator plugin that lets you automate many common tasks. However, we’ll be using Uncanny Automator pro because it works with WooCommerce.

    To start, you’ll need to install Uncanny Automator pro, plus the free plugin as it provides the base for the premium version. If you need help, then please see our guide on how to install a WordPress plugin.

    Upon activation, go to Automator » Settings and enter your license key into the ‘Uncanny Automator Pro license key’ field.

    Adding an Uncanny Automator license to your WordPress website

    You’ll find this information under your account on the Uncanny Automator website.

    Uncanny Automator is a powerful and flexible plugin, so there’s lots of different ways that you can bring customers back to your site. Let’s take a look at a few options.

    Automatically Send Coupons to Logged-Out Customers

    It’s smart to let customers create an account with your online store, as it encourages brand loyalty and makes it easier for shoppers to buy from you in the future.

    User registration can also help with lead generation. If you get the shopper’s email address, then you can target them with email marketing, personalized ads, an email newsletter, and much more.

    If you’re using WooCommerce, then this plugin automatically creates all the pages customers need to create and manage an account. WooCommerce also adds a new Customer role, which it automatically assigns to any shoppers who register with your store.

    Are you using a different eCommerce solution that doesn’t support customer registration? Then see our guide on how to allow user registration on your WordPress site.

    After that, you can simply create a new role for your customers. For detailed instructions, please see our beginner’s guide to WordPress user roles and permissions.

    If you allow user registration, then you can track when a shopper logs out of their account, as this suggests they’re losing interest in your store. You can then send a coupon to encourage them to log back in.

    To create this recipe, simply go to Automator » Add new in the WordPress dashboard.

    Uncanny Automator will now ask whether you want to create a recipe for logged-in users, or everyone. Go ahead and select ‘Logged-in users,’ then click on the ‘Confirm’ button.

    Creating a logged-in automation recipe with Uncanny Automator

    Next, you can give the recipe a name by typing into the ‘Title’ field. This is just for your reference so you can use anything you want.

    Once you’ve done that, click on ‘WordPress’ in the ‘Select an integration’ area.

    Select WooCommerce as an integration

    You can now choose a trigger, which is anything that kickstarts the recipe.

    In the dropdown menu, start typing the following ‘A user logs out of a site’ and then select the right option when it appears.

    Choosing a trigger for the automated coupon recipe

    We only want to run the workflow when someone with the ‘Customer’ user role logs out of their account.

    With that in mind, click on the ‘Add filter’ button.

    How to create an automation workflow for your WooCommerce customers

    In the popup that appears, click on ‘WordPress.’

    Next, find ‘The user has a specific role’ in the dropdown menu.

    Filtering your users based on WordPress role

    Open the ‘Role’ dropdown and select the role you’re using for your customers.

    After that, go ahead and click on ‘Save filter.’

    Sending an automated coupon to your WooCommerce customers

    Now it’s time to specify the action that Uncanny Automator will perform every time this workflow runs.

    We’re going to send the customer an email containing a coupon, so go ahead and click on ‘Add action.’

    Adding actions to an automated recipe

    Since we want to send an email, select ‘Emails’ as the integration.

    In the dropdown that appears, click on ‘Send an email.’

    Send automated coupons in WordPress to bring back customers

    This adds all the fields that you can use to create the email.

    To start, we need to make sure the message goes to the right user, by clicking on the asterisk next to the ‘To’ field. Then, select ‘Common’ and ‘User email.’

    Getting the customer's email address

    You can now create the email by adding a subject line and body text.

    Here, you can use a mix of plain text and tokens, which are placeholders that Uncanny Automator replaces with real values automatically. For example, if you want to use the customer’s name, then you can click on the asterix and select ‘Common.’

    Simply select the ‘User first name’ token to create the personalized greeting.

    Adding a dynamic user name token to the coupon workflow

    You’ll also need to create a coupon and add it to the email.

    The easiest way is by using the Advanced Coupons plugin, which is the best WordPress coupon code plugin on the market. It lets you create lots of different advanced coupons to get more sales and grow your business.

    For a step-by-step guide, please see our post on how to create smart coupons.

    After creating a coupon, you can simply add it to the email.

    Sending an automated coupon email in WordPress to bring back customers

    When you’re happy with how the email looks, click on ‘Save.’

    After that, it’s time to set a delay. This is how long Uncanny Automator will wait after the customer logs out, before sending them the coupon.

    To add a delay, hover your mouse over the ‘Email’ action. When it appears, click on ‘Delay.’

    How to add a delay to an automation workflow

    You can then add your delay in the popup that appears.

    Once you’ve done that, go ahead and select ‘Set delay.’

    Adding a time delay to the automated coupon recipe

    When you’re happy with how the recipe is set up, it’s time to make it active.

    In the ‘Recipe’ box, click the ‘Draft’ switch so that it shows ‘Live’ instead.

    Publishing the automated coupon recipe

    That’s it. Now, when a customer logs out of their account, Uncanny Automator will wait for the specified amount of time before sending them a coupon code.

    Automatically Send Coupons for a Specific Product

    Sometimes a shopper may look at a product multiple times. This suggests they’re interested in the item, but something is stopping them from making a purchase.

    In this case, you may want to send them a coupon, which will encourage them to splash out on the product.

    To get started, create a new recipe for logged-in users following the same process described above. After that, click on ‘WooCommerce’ in the ‘Select an integration’ area.

    Adding WooCommerce as an integration in Uncanny Automator

    Next, choose a trigger by typing the following ‘A user views a product.’

    When the right trigger appears, give it a click.

    Get more sales with an automated coupon recipe

    By default, this trigger is set to ‘Any product.’

    If you want to link the recipe to a specific product, then open the ‘Product’ dropdown and choose that product from the list.

    Choose a WooCommerce product from the dropdown menu

    Once you’ve done that, click on the ‘Number of times’ button.

    By default, the recipe will run every time a customer looks at a product. You should change this, so the customer has to look at the product multiple times before triggering the recipe. To do this, type a different number into the ‘Number of times’ field.

    Triggering a workflow when the customer views a product multiple times

    When that’s done, click on ‘Save’ to store your settings.

    This recipe should only run when a customer views a product, so click on ‘Add Filter.’ In the popup that appears, click on ‘WordPress’ and then choose ‘The user has a specific role.’

    Adding WooCommerce features to an automation recipe

    After that, open the ‘Role’ dropdown and select the role you’re using for your customers.

    When you’re ready, click on ‘Save filter.’

    Configuring the automated coupon rule

    Now it’s time to add the action. There are a few different ways to send automated coupons from your WordPress website.

    To email a code to your customers using Uncanny Automator and Advanced Coupons, simply follow the same process described above.

    Another option is to generate the code using WooCommerce. To do this, click on ‘Add Action’ and then select ‘WooCommerce’ as the integration.

    Selecting the WooCommerce eCommerce plugin as an integration

    In the search bar, start typing ‘Generate and email a coupon code to the user.’

    When the right option appears, give it a click.

    Generating a WooCommerce coupon

    This will add some new settings where you can create the coupon code.

    To generate a code automatically, simply leave the ‘Coupon code’ field blank.

    How to create a coupon for your WooCommerce online store

    In the ‘Discount type’ field, choose the kind of coupon that you want to create, such as a fixed cart discount or percentage discount.

    For this guide, we’ll select ‘Percentage discount’.

    How to create a percentage discount code

    After that, type the percentage discount into the ‘Coupon amount’ field.

    In the following image, we’re offering customers a 30% discount on their purchase.

    Creating a percentage coupon code

    In the next field, you can set an expiry date for the coupon, either by using the YYY-MM-DD format or typing in the number of days until the coupon expires.

    For example, in the following image the coupon will expire after 7 days.

    Adding an expiration date to an automated coupon code

    You can also set a minimum and maximum spend for the coupon. We’ll leave these fields blank so the customer can use the code with any purchase.

    You may also want to check the ‘For individual use only’ box so customers can’t use this code in combination with other coupons.

    Creating a coupon for individual use

    Next, scroll to the ‘Usage limit per coupon’ section. The shopper should only be able to use the coupon once, so type in ‘1.’

    There are lots of other settings you can change for the coupon. It’s a good idea to look through these settings to see whether you want to make any more changes.

    When you’re happy with how the coupon is set up, scroll to the ‘Email’ section. To start, find the ‘To’ field and then click on the asterisk next to it. Then, click on ‘Common’ and select ‘User email.’

    Creating an automated coupon email to bring back shoppers

    With that done, you can add a subject line and change the text in the email body.

    To create a more personalized email, it’s a good idea to use a mix of plain text and tokens, by following the same process described above.

    Adding a coupon to your WooCommerce email

    When you’re happy with the email, click on the ‘Save’ button to store the recipe.

    After that, you can make the recipe live by clicking the ‘Draft’ switch so that it shows ‘Live.’

    Making an Uncanny Automator recipe live on your WordPress website

    Now, every time someone views a product multiple times, it’ll trigger the recipe workflow.

    We hope this article helped you learn how to send automated coupons in WordPress to bring back customers. You may also want to check out our guide on how to create a WooCommerce popup to increase sales and the best WooCommerce plugins for your store.

    If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

    The post How to Send Automated Coupons in WordPress to Bring Back Customers first appeared on WPBeginner.

  • Introducing SendLayer – Reliable WordPress Email Deliverability Made Easy

    Are you tired of your website emails being marked as spam?

    Have you ever wished there was an easy and reliable way to get your website emails delivered to your customer’s inbox WITHOUT the high costs?

    If you’re like me and most other smart website owners, then you have at least wished for this solution a couple times in your WordPress journey.

    Today, I’m excited to announce my new product, SendLayer, which will level up your website’s email infrastructure.

    We built this tool to help you get your website emails into your user’s inbox with maximum deliverability, reliability, and scalability.

    Introducing SendLayer - SMTP Email Service for WordPress

    What is SendLayer?

    SendLayer is a SMTP email service API that helps your website emails get into customer’s inbox without being marked as spam.

    It offers blazing fast email delivery while protecting your domain reputation from spam filters and giving you detailed email logs along with open & click analytics.

    SendLayer Effect

    SendLayer seamlessly connects with WordPress, so you can use it to reliably send website emails like store receipts, confirmation emails, shipping notifications, password reset emails, and other WordPress emails with maximum reliability.

    Why Do You Need SendLayer?

    If you’re like most users, then you have likely run into the problem of WordPress not sending email issue. This is one of the most commonly asked questions on WPBeginner.

    Many of our beginner level users ask us why their contact form plugin is not sending emails, or why they are not seeing any WordPress notifications.

    That’s because most WordPress hosting servers are not configured to send emails using the default PHP mail() function.

    And even if your hosting server is configured properly, many email service providers like Gmail, Outlook, and others use sophisticated tools to reduce email spam. These tools try to detect if an email is really coming from the location that it claims to be.

    Emails sent by WordPress websites often fail the test.

    This means that majority of the emails sent by your website will either land in user’s spam inbox or not get delivered at all. This include your website’s contact form plugin emails, your online store receipts, password reset emails, admin notifications, and more.

    This is why most smart website owners use SMTP for sending emails in WordPress.

    And this is why I created the free WP Mail SMTP plugin which is used by over 3 million websites.

    How SMTP Works

    But the problem was that a lot of beginner users still didn’t know how to set up SMTP properly because simply installing the plugin isn’t enough.

    You still needed to use a SMTP email service that’s built for maximum deliverability, reliability, and scalability. We integrated with numerous service providers like Amazon, Google, etc, but they were all quite difficult to use for beginners.

    So after listening to a lot of our user feedback, I decided to work with my team to finally create a beginner-friendly SMTP service, SendLayer, that works for all types of websites including WordPress.

    Whether you’re using WordPress, WooCommerce, Magento, Laravel, Drupal, Joomla, or any other platform, you can use SendLayer to improve your email deliverability.

    SendLayer gives you access to:

    • Awesome email deliverability
    • Spam Filter protection
    • Detailed email logs
    • Open and click analytics
    • Event-based webhooks to setup custom notifications
    • SMTP relay API for those that want to use SendLayer inside custom apps
    • Simple suppression list to protect your delivery reputation

    … and a whole lot more.

    Basically, if you’re serious about your website and want to grow your online business, then you know that email deliverability is important.

    And SendLayer offers you one of the best email infrastructure in the market.

    SendLayer Types of Emails

    Once connected with your WordPress site, it automatically ensures that all your website emails get delivered in your user’s inbox.

    How to use SendLayer with WordPress?

    First thing you need to do is create a free SendLayer account.

    SendLayer best SMTP service provider

    Next, you need to install and activate the free WP Mail SMTP plugin. For more details, see our step by step guide on how to install a WordPress plugin.

    Upon activation, go to WP Mail SMTP settings page in your WordPress admin menu. Once this page, you need to select the SendLayer mailer.

    SendLayer connection for WordPress

    Next, you will need to enter your SendLayer API key in the field below.

    You can get this API key by following the link on the plugin page which will take you to SendLayer account.

    Once the key is added, you should send a test email using WP Mail SMTP to ensure everything is working.

    For more details, see the full documentation here.

    What’s Coming Next in SendLayer?

    While I’m sharing the SendLayer news with you today, SendLayer has actually been out since April of 2022. After extensively testing it through out 2021, we did a soft-launch earlier in the year and have since onboarded thousands of website owners already using the platform.

    We have a really exciting roadmap ahead of us, and I’m really proud of our team.

    We are working on building ,pre cutting-edge email delivery tools to help small business owners and online store owners get their emails delivered into their user’s inbox, so you can continue to maximize your revenue growth.

    If you have ideas on how we can make the SendLayer platform more helpful for you, then please send us your suggestions.

    As always, I want to thank you for your continued support of WPBeginner, and we look forward to continue serving you for years to come.

    Yours Truly,

    Syed Balkhi
    Founder of WPBeginner

    The post Introducing SendLayer – Reliable WordPress Email Deliverability Made Easy first appeared on WPBeginner.