Category Archives: Tutorials

How to Fix ’ERR_SSL_VERSION_OR _CIPHER_MISMATCH’ in WordPress

Is the ‘ERR_SSL_VERSION_OR_CIPHER_MISMATCH’ error stopping you from accessing a WordPress website?

This error is only seen when visiting a website that uses an SSL certificate. It is caused by out-of-date or misconfigured software on either the website or the user’s computer.

In this article, we will show you how to fix the ‘ERR_SSL_VERSION_OR_CIPHER_MISMATCH’ error in WordPress.

How to Fix ’ERR_SSL_VERSION_OR_CIPHER_MISMATCH’ in WordPress

What Is the ERR_SSL_VERSION_OR_CIPHER_MISMATCH Error?

We recommend that everyone with a WordPress website install an SSL certificate. This can help keep your website data secure.

An SSL certificate is required if you want to accept payments in your online store, and it also protects your users in other ways.

Recommended: Check out our guide on how to get a free SSL certificate or buy an SSL certificate at a discount from Domain.com.

SSL stands for ‘Secure Sockets Layer’, and TLS stands for ‘Transport Layer Security’ protocol. These protocols rely on certificates that tell the user the identity of the website they are communicating with.

When visiting a secure website, your browser will automatically check for an SSL certificate to see if it is valid and up to date. It also checks the version of the protocols being used.

If there’s an issue, then you’ll see an SSL error like ERR_SSL_VERSION_OR_CIPHER_MISMATCH.

The ’ERR_SSL_VERSION_OR_CIPHER_MISMATCH’ Error Message

This error message appears when your browser doesn’t recognize the version of the SSL protocol being used or when the SSL certificate is not configured correctly.

This can happen when the user is using an out-of-date web browser that doesn’t recognize the latest TLS protocols. It can also be caused if the website’s SSL certificate or software is out of date or mismatched.

With that being said, let’s take a look at some steps you can take to fix the ERR_SSL_VERSION_OR_CIPHER_MISMATCH error in WordPress:

Scanning Your Website for SSL Errors

The first thing you need to do is scan your WordPress website for SSL errors. This will help you identify problems that can cause the ‘ERR_SSL_VERSION_OR_CIPHER_MISMATCH’ error.

The easiest way to check is by using an online tool like the Qualys SSL Labs SSL Server Test. Simply type in the website’s domain name and then click the ‘Submit’ button.

Scanning Your Website With Qualys SSL Labs SSL Server Test

This will perform a thorough test on the website that takes a few minutes to finish. After that, you will see a very detailed report about the site’s SSL certificate.

In the screenshot below, you will find the results of a scan on wpbeginner.com. You can see that the WPBeginner SSL certificate is valid and trusted and supports the latest TLS protocol, which is TLS 1.3. This is an example of a great SSL test result.

SSL Test Result With an Excellent Result

You can scroll down to the Configuration section of the report.

This will show you which versions of the TLS protocol are supported. In this case, both currently used versions are supported, which are TLS 1.2 and TLS 1.3.

Supported TLS Protocols Listed

It’s also important that the other protocols are not being used because they have known security issues.

If your test result looks similar to this, then the ‘ERR_SSL_VERSION_OR_CIPHER_MISMATCH’ error is not being caused by the website. You can scroll down to the last section of this tutorial to learn how to troubleshoot the software on your computer.

On the other hand, here is a screenshot from a scan that found SSL errors. The errors are summarized at the top of the report, and more details are given below.

You can go to a page with detailed notes about an error by clicking the ‘MORE INFO »’ link.

SSL Test Result With a Poor Result

If the SSL test report for your website lists some SSL errors, then you can follow these guidelines to fix them.

Your Site Uses Outdated TLS 1.0, TLS 1.1, or RC4 Cipher Suite

Old TLS protocols like TLS 1.0 and TLS 1.1 should never be run because they have security issues, and modern web browsers have stopped supporting them.

The same goes for the RC4 cipher suite. A cipher suite is a set of algorithms used to secure your website with TLS. However, the RC4 version has been found to be insecure and should never be used.

Reputable WordPress hosting companies never use insecure versions of the TLS protocol or cipher suite.

However, if your website is using any of these outdated versions, then you should contact your hosting provider and get them to enable TLS 1.2 or TLS 1.3. You will also need to switch to AEAD cipher suites (AES-GCM).

Alternatively, you can move to a reliable hosting provider like Bluehost or SiteGround.

Your Site Has an SSL Certificate Name Mismatch

Because an SSL certificate proves that your website is what it claims to be, the domain name on your certificate must match your site’s domain name. When they are not the same, this is called an ‘SSL certificate name mismatch’.

When you see this error in your SSL report, it will list the potential reasons:

  • The website does not use SSL but shares an IP address with some other site that does.
  • The website no longer exists, yet the domain name still points to the old IP address, where some other site is now hosted.
  • The website uses a content delivery network (CDN) that does not support SSL.
  • The domain name is an alias for a website whose main name is different, but the alias was not included in the certificate by mistake.
Certificate Name Mismatch Error

This error is likely caused by a problem with your SSL setup.

You can take a look at our beginner’s guide on how to properly move WordPress from HTTP to HTTPS for details on how to set up SSL correctly.

In particular, make sure you have set up your SSL certificate to work with all of the variations (or aliases) of your domain name that will be used, including www and non-www URLs.

Another solution is to redirect your website visitors to the correct variation of your domain name.

For example, if your SSL certificate has the URL ‘https://www.example.com’, then you can redirect ‘https://example.com’ to that address. See our article on how to set up redirects in WordPress for more details.

This error could also appear if you have recently moved your website to a new domain name or server. You will need to update your SSL certificate with the new details.

If you are using a CDN service, then you should also make sure that it supports SSL. If you need to upgrade, then you can see our expert picks of the best WordPress CDN services for recommendations.

If you need help with any of these issues, then don’t hesitate to reach out to your hosting provider’s technical support team.

When the Website Is Not the Problem

If the website is not the problem, then the error is caused by software on your computer. Most likely, you have an out-of-date web browser, or your antivirus software is causing the error.

You can follow these steps to troubleshoot the problem.

Update Your Web Browser to the Latest Version

If you are using an outdated web browser such as Internet Explorer or an old version of a modern web browser, then you may see this error. This happens because the old software was written before the latest versions of the TLS protocols and doesn’t recognize them.

In that case, all you need to do is switch to the latest version of a modern web browser like Google Chrome.

If, for some reason, you can’t update to a later version of your browser, like if you are stuck using Microsoft Windows XP, then you may be able to enable a later version of TLS in your browser.

For example, on Google Chrome, you can type chrome://flags in the address bar, search for ‘TLS 1.3’ and enable the option.

Or if you are using Firefox, then you should type about:config in the address bar, search for TLS, and then set the security.tls.version.max value to 4.

Force Firefox to Use Current TLS Protocols

Clear Your Browser Cache and SSL Cache

If you still see the error message after doing this, then there are a few more troubleshooting steps you can take. The first thing is to delete your browser cache and cookies.

You can see our guide on how to clear your cache in all major browsers, which also covers how to clear your cookies.

On Windows, you can also clear the SSL cache. This may be storing out-of-date SSL information about the website you are trying to access.

You can open ‘Internet Options’ by searching for it in the Start menu. Now switch to the Content tab and click on the ‘Clear SSL state’ button.

Windows Internet Properties

Temporarily Disable Your Antivirus Software

Finally, it’s possible that your antivirus software or firewall software may be configured incorrectly. This can sometimes cause the ‘ERR_SSL_VERSION_OR_CIPHER_MISMATCH’ error to appear when it shouldn’t.

If your software has an automatic SSL scanning feature, then you can try turning it off. Otherwise, you will need to temporarily disable your antivirus software. Once you have done that, you can try accessing the website again.

If you can access the software with your antivirus software disabled, then you can contact the antivirus company’s technical support team about the error or switch to a more reputable application.

We hope our tutorial helped you fix the ‘ERR_SSL_VERSION_OR_CIPHER_MISMATCH’ error in WordPress. You may also want to see our complete guide to WordPress security or our expert picks for the best WordPress security plugins to further protect 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 Fix ’ERR_SSL_VERSION_OR _CIPHER_MISMATCH’ in WordPress first appeared on WPBeginner.

WordPress Custom Fields 101: Tips, Tricks, and Hacks

Are you looking to make the most of custom fields on your WordPress website?

Custom fields are a handy WordPress feature that allows you to add extra data and information to your WordPress posts and pages. A lot of popular WordPress plugins and themes use custom fields to store important data.

In this article, we will show you how to use WordPress custom fields with some tips, tricks, and hacks.

WordPress custom fields 101 tips tricks and hacks

Since this is a long article, we have added a table of contents for easier navigation. Just use the quick links below to jump to the section you want to read:

What Are WordPress Custom Fields?

WordPress custom fields are metadata used to add extra information to the post or page you are editing.

By default, when you write a new post, page, or any other content type, WordPress saves that content in two different parts.

The first part is the body of your content that you add using the WordPress content editor.

The second part is the information about that content. For example, the title, author, date, time, and more. This information is called metadata.

A WordPress website automatically adds all the required metadata to each post or page you create. You can also create and store your own metadata by using custom fields.

By default, the custom fields option is hidden on the post edit screen. To view it, you need to click on the three-dot menu in the top-right corner of the screen and select ‘Preferences’ from the menu.

Open preferences in content editor

This will open a popup where you need to switch to the ‘Panels’ tab and then enable the ‘Custom fields’ option.

After that, simply click on the ‘Enable & Reload’ button to reload the post editor.

Enable custom fields option

The post editor will reload, and you will be able to see the Custom Fields panel below the content editor.

Custom fields can be used to add any information related to the post, page, or other content type. This meta information can then be displayed in your theme.

View custom fields in WordPress

However, to do that, you will need to edit your WordPress theme files.

Note: This tutorial is recommended for users who are already familiar with editing theme files. It is also helpful for aspiring WordPress developers who want to learn how to properly use custom fields in their own themes or plugins.

Having said that, let’s take a look at how to add and use custom fields in WordPress.

Adding Custom Fields in WordPress

First, you need to open a post or page in the block editor so that you can add custom fields. Then, you must go to the Custom Fields meta box.

Adding custom field name and value

Next, you need to provide a Name for your custom field and then enter its Value. Click on the ‘Add Custom Field’ button to save it.

The field will be stored and displayed in the Custom Fields meta box like this:

View newly created custom field

You can edit this custom field any time you want and then just click on the ‘Update’ button to save your changes. You can also delete it if you don’t want to use it anymore.

Now, you need to save your post to store your custom field settings.

Displaying Custom Fields in WordPress Themes

To display your custom field on your website, you will need to edit your WordPress theme files and code snippets.

We don’t recommend directly editing the theme files because the slightest mistake can break your website. An easier way to do this is by using WPCode.

It is the best code snippet plugin for WordPress that lets you add custom code and manage snippets from your WordPress dashboard.

If you haven’t done this before, then we also recommend reading our guide on how to copy and paste code in WordPress.

First, you will need to install and activate the free WPCode plugin. For more details, please see our beginner’s guide on how to install a WordPress plugin.

Upon activation, you will need to go to Code Snippets » + Add Snippet from the WordPress dashboard and select the ‘Add Your Custom Code (New Snippet)’ option.

Adding a code snippet to your WordPress website

Now you need to copy this code to add to your theme files:

<?php echo get_post_meta($post->ID, 'key', true); ?>

Don’t forget to replace key with the name of your custom field.

Next, you must enter the code into the ‘Code Preview’ area and change the Code Type to ‘PHP Snippet’.

Enter custom fields code

For example, we used this code in our demo theme:

<p>Today's Mood: <?php echo get_post_meta($post->ID, 'Mood', true); ?></p>

From here, you can scroll down to the Insertion section.

Here, you can select where the code will run. By default, WPCode will Auto Insert the code and run it everywhere on your website.

Edit insertion method for code

However, you can change this and select where you would like the custom field to appear.

For example, we will choose the ‘Page Specific’ tab and select the ‘Insert Before Post’ option. This way, the custom field will appear at the beginning of the blog post.

Insert before post

You can now save your changes and visit the post where you added the custom field to see it in action.

You can use this custom field in all your other WordPress blog posts as well.

Displaying custom field

You can also easily adjust the custom field for different blog posts. Simply create a new post or edit an existing one.

Then, go to the Custom Fields meta box and select your custom field from the dropdown menu and enter its Value.

Reuse custom field

Once you are done, simply click the ‘Add Custom Field’ button to save your changes and then publish or update your post.

Troubleshooting: Can’t Find Custom Field in Dropdown on Post Edit Screen

By default, WordPress only loads 30 custom fields in the dropdown menu on the post edit screen.

If you are using WordPress themes and plugins that already use custom fields, then those might appear first in the dropdown menu, and you won’t be able to see your newly-created custom field.

To fix this issue, you will need to add the following code to your theme’s functions.php file or by using WPCode (recommended):

add_filter( 'postmeta_form_limit', 'meta_limit_increase' );
function meta_limit_increase( $limit ) {
    return 50;
}

The above code will change that limit to 50. If you still can’t see your custom field, then you can try increasing that limit even further.

Creating a User Interface for Custom Fields Using Advanced Custom Fields

As you can see, once you add a custom field, you will have to select the field and enter its value each time you write a post.

If you have many WordPress custom fields or multiple authors writing on your website, then this is not an ideal solution.

Wouldn’t it be nice if you could create a user interface where users can fill in a form to add values to your custom fields?

In fact, this is what so many popular WordPress plugins already do.

For example, the SEO title and meta description box inside the popular All in One SEO plugin is a custom meta box:

AIOSEO SEO title and description

The easiest way to create a user interface for adding custom fields is by using the Advanced Custom Fields plugin.

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

Upon activation, you need to visit the ACF » Field Groups page and click on the ‘Add New’ button.

Add new field group

A field group is like a container with a set of custom fields. It allows you to add multiple panels of custom fields.

Now, you need to provide a title for your field group and click the ‘+ Add Field’ button in the top-right corner.

Add new field

You can now select a field type.

Advanced Custom Fields allows you to create all sorts of fields, including text, image upload, number, dropdown, checkboxes, and more.

Select field type and other details

Next, you can scroll down to see other options for that particular field, like field name, field label, and default value. You can change them to your own requirements.

You can also add multiple fields to your field group if you want. Once you are finished, just click on the ‘Save Changes’ button.

View new field group

Next, edit a post or create a new one, and you will see a new panel with your WordPress custom fields below the content editor.

For detailed step-by-step instructions, you can see our guide on how to add custom meta boxes in WordPress posts and post types.

How to Hide Empty Custom Fields With Conditional Statements

So far, we have covered how to create a custom field and display it in your theme.

Now let’s see how to check that the custom field is not empty before displaying it. To do that, we will modify our code to first check if the field has data in it:

<?php 

$mood = get_post_meta($post->ID, 'Mood', true);

if ($mood) { ?>

<p>Today's Mood: <? echo $mood; ?></p>

<?php 

} else {
// do nothing;
}

?>

Don’t forget to replace Mood with your own custom field name.

Adding Multiple Values to a Custom Field

Custom fields can be reused in the same post to add multiple values. You just need to select the field again and add another value to the ‘Value’ box.

Adding multiple values to a custom field

However, the code we have used in the above examples will only be able to show a single value.

To display all values of a custom field, we need to modify the code and make it return the data in an array. You will need to add the following code to your theme file:

<?php 
$mood = get_post_meta($post->ID, 'Mood', false);
if( count( $mood ) != 0 ) { ?>
<p>Today's Mood:</p>
<ul>
<?php foreach($mood as $mood) {
            echo '<li>'.$mood.'</li>';
            }
            ?>
</ul>
<?php 
} else { 
// do nothing; 
}
?>

Again, don’t forget to replace Mood with your own custom field name.

In this example, you will notice that we have changed the last parameter of get_post_meta function to false. This parameter defines whether the function should return a single value or not. Setting it to false allows it to return the data as an array, which we then displayed in a foreach loop.

How to Search Posts by Custom Field in WordPress

WordPress’s default search doesn’t work with any custom fields on your website. It only uses the content to find the post you or your visitors are looking for on your site.

However, SearchWP changes that by improving your WordPress search. It’s the best WordPress search plugin that goes beyond using the post content and indexes everything, including WordPress custom fields, PDF documents, custom tables, text, files, and more.

You can adjust the search algorithm without editing code using SearchWP. Simply install the plugin and then head over to SearchWP » Algorithm from your WordPress admin area.

After that, you need to go to the ‘Engines’ tab and then adjust the Attribute Relevance slider. This will change the importance given to each attribute during a search.

Adjust the search relevance

For instance, you can set the Custom Fields slider to maximum and adjust sliders for other attributes accordingly. This way, SearchWP will give preference to data in custom fields when searching for content in WordPress.

Another advantage of using SearchWP is that works with some of the most popular custom field plugins, including Advanced Custom Fields (ACF), Meta Box, and Pods.

For more details, you can read our beginner-friendly guide on how to improve WordPress search with SearchWP.

Displaying Posts With a Specific Custom Key

WordPress allows you to display posts with custom keys and their values. For example, if you are trying to create a custom archive page to display all posts with specific custom keys, then you can use the WP_Query class to query posts matching those fields.

You can use the following code as a starting point:

$args = array(
    'meta_key'   => 'Mood',
    'meta_value' => 'Happy'
);
$the_query = new WP_Query( $args );
 
<?php 
// the query
$the_query = new WP_Query( $args ); ?>
 
<?php if ( $the_query->have_posts() ) : ?>
 
    <!-- the loop -->
    <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
        <h2><?php the_title(); ?></h2>
        <?php the_content(); ?>
 
    <?php endwhile; ?>
    <!-- end of the loop -->
 
    <!-- pagination here -->
 
    <?php wp_reset_postdata(); ?>
 
<?php else : ?>
    <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>

Don’t forget to replace meta_key and meta_value parameters with your own values.

How to Add Guest Author Name Using Custom Fields

Do you want to add a guest post but don’t want to add a new user profile just for that post? An easier method is adding a guest author name as a custom field.

To do this, you will need to add the following code to your theme’s functions.php file or use WPCode (recommended):

add_filter( 'the_author', 'guest_author_name' );
add_filter( 'get_the_author_display_name', 'guest_author_name' );
function guest_author_name( $name ) {
global $post;
$author = get_post_meta( $post->ID, 'guest-author', true );
if ( $author )
$name = $author;
return $name;
}

For more details, please see our guide on pasting snippets from the web into WordPress.

This code hooks a function to the_author and get_the_author_display_name filters in WordPress.

The function first checks for the guest author’s name. If it exists, then it replaces the author’s name with the guest author’s name.

Now you will need to edit the post where you want to display the guest author’s name. Go to the Custom Fields meta box, add your guest author name, and finally click on the ‘Add Custom Field’ button.

Guest author custom field

For more details, see our article on how to rewrite guest author names with custom fields in WordPress.

How to Display Contributors to an Article Using Custom Fields

On many popular blogs and news sites, many authors contribute to writing a single article. However, WordPress only allows a single author to be associated with a post.

One way to solve this problem is by using the Co-Authors Plus plugin. To learn more, see our guide on how to add multiple authors to a WordPress post.

Another method is adding contributors as a custom field.

First, you need to edit the post where you want to display co-authors or contributors. Then, scroll down to the Custom Fields meta box and add author names as co-author custom fields.

Add coauthor custom fields

Now, you need to add this code to your theme files where you want to show co-authors:

<?php 
 
$coauthors = get_post_meta($post->ID, 'co-author', false);
if( count( $coauthors ) != 0 ) { ?>
<ul class="coauthors">
<li>Contributors</li>
<?php foreach($coauthors as $coauthors) { ?>
           <?php echo '<li>'.$coauthors.'</li>' ;
            }
            ?>
</ul>
<?php 
} else { 
// do nothing; 
}
?>

To display author names separated by commas, you can add the following custom CSS:

.coauthors ul { 
display:inline;
}
.coauthors li { 
display:inline;
list-style:none;
}
.coauthors li:after { 
content:","
}
.coauthors li:last-child:after {
    content: "";
}
.coauthors li:first-child:after {
    content: ":";
}

This is how it looked on our demo site.

Coauthors custom fields preview

How to Display Custom Fields Outside the Loop in WordPress

What if you need to show custom fields in the sidebar of a single post?

To display the custom fields outside the WordPress loop, you can add the following code to your theme files:

<?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'key', true);
wp_reset_query();
?>

Don’t forget to replace key with your custom field name.

Display a Custom Header, Footer, Sidebar Using Custom Fields

Usually, most WordPress themes use the same header, footer, and sidebar on all pages.

There are also many ways to show different sidebars, headers, or footers for different pages on your website. You can see our guide on how to display a different sidebar for each WordPress post or page.

One way to do this is by using custom fields. Just edit the post or page where you want to show a different sidebar and then add the sidebar as a custom field.

Add sidebar custom field

Now you need to edit your WordPress theme file, such as single.php, where you want to display a custom sidebar. You will be looking for the following code:

<?php get_sidebar(); ?>

Replace this line with the following code:

<?php
global $wp_query;
$postid = $wp_query->post->ID;
$sidebar = get_post_meta($postid, "sidebar", true);
get_sidebar($sidebar);
wp_reset_query();
?>

This code simply looks for the sidebar custom field and then displays it in your theme. For example, if you add webpage as your sidebar custom field, then the code will look for a sidebar-webpage.php file to display.

You will need to create the sidebar-webpage.php file in your theme folder. You can copy the code from your theme’s sidebar.php file as a starting point.

Manipulating RSS feed Content With Custom Fields

Want to display additional metadata or content to your RSS feed users? Using custom fields you can manipulate your WordPress RSS feed and add custom content into your feeds.

First, you need to add the following code to your theme’s functions.php file or use WPCode (recommended):

function wpbeginner_postrss($content) {
global $wp_query;
$postid = $wp_query->post->ID;
$coolcustom = get_post_meta($postid, 'coolcustom', true);
if(is_feed()) {
if($coolcustom !== '') {
$content = $content."<br /><br /><div>".$coolcustom."</div>
";
}
else {
$content = $content;
}
}
return $content;
}
add_filter('the_excerpt_rss', 'wpbeginner_postrss');
add_filter('the_content', 'wpbeginner_postrss');

Now, just create a custom field called ‘coolcustom’ and add any value you like. You can use it to display advertisements, images, text, or anything you want.

For more details, please see our guide on how to copy and paste code from the web into WordPress.

How to Manipulate RSS Feed Title With Custom Fields

Sometimes you may want to add extra text to a post title for RSS feed users. For example, this can be handy if you are publishing a sponsored post or a guest post.

First, you need to add the following code to your theme’s functions.php file or use WPCode to add the custom code snippet without breaking your website:

function wpbeginner_titlerss($content) {
global $wp_query;
$postid = $wp_query->post->ID;
$gpost = get_post_meta($postid, 'guest_post', true);
$spost = get_post_meta($postid, 'sponsored_post', true);

if($gpost !== '') {
$content = 'Guest Post: '.$content;
}
elseif ($spost !== ''){
$content = 'Sponsored Post: '.$content;
}
else {
$content = $content;
}
return $content;
}
add_filter('the_title_rss', 'wpbeginner_titlerss');

Next, you need to edit the post where you want to display the extra text in the title field.

Then, add guest_post and sponsored_post as custom fields.

Add guest post custom field

If either of these two custom fields is found with a value “true”, then the code will add the appropriate text before the title. This technique can be used in many ways to fit whatever you like.

Want to learn more cool RSS feed hacks? See our guide on how to add content and manipulate your WordPress RSS feeds.

How to Set Expiration Date for Posts in WordPress Using Custom Fields

Want to set an expiration date for some posts on your WordPress site? This comes in handy when you want to publish content only for a specific period like running surveys or limited-time offers.

One way to do this is by manually removing the post content or by using a plugin like Post Expirator.

Another option is using custom fields to automatically expire posts after a specific time. You will need to edit your theme files and modify the WordPress loop like this:

<?php
if (have_posts()) :
while (have_posts()) : the_post();
$expirationtime = get_post_meta($post->ID, "expiration", false);
if( count( $expirationtime ) != '' ) {
if (is_array($expirationtime)) {
$expirestring = implode($expirationtime);
}

$secondsbetween = strtotime($expirestring)-time();
if ( $secondsbetween >= 0 ) {
echo 'This post will expire on ' .$expirestring.'';
the_content();
} else {
echo "Sorry this post expired!"
}
} else {
the_content();
}
endwhile;
endif;
?>

Note: You will need to edit this code to match your theme.

After adding this code, you can add the expiration custom field to the post you want to expire. Make sure you add the time in this format mm/dd/yyyy 00:00:00.

Adding an expiration date using custom field

How to Style Individual Posts Using Custom Fields

Want to change the look of an individual post using CSS? WordPress automatically assigns each post its own class, which you can use to add custom CSS.

However, by using custom fields, you can add your own custom classes and then use them to style posts differently.

First, you need to edit a post that you would like to style differently. Go to the Custom Fields box and add the post-class custom field.

Post class custom field

Next, you need to edit your WordPress theme files and add this code at the beginning of the WordPress loop:

<?php $custom_values = get_post_meta($post->ID, 'post-class'); ?>

Now you need to find the line with the post_class() function.

Here is how it looked in our demo theme:

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

You must change this line to include your custom field value, like this:

<article id="post-<?php the_ID(); ?>" <?php post_class($custom_values); ?>>

Now if you examine the post’s source code using the Inspect tool, then you will see your custom field CSS class added to the post-class.

Post class preview

You can now can use this CSS class to add custom CSS and style your post differently.

We hope this article helped you learn more about WordPress custom fields. You may also want to see our guide on how to add custom meta fields to custom taxonomies in WordPress and the best WordPress page builder plugins to help you design your website the way you want.

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 WordPress Custom Fields 101: Tips, Tricks, and Hacks first appeared on WPBeginner.

How to Add Express Checkout Buttons in WooCommerce

Are you looking to add an express checkout button to your online store?

Express checkout helps streamline the checkout process and improves the overall shopping experience for your customers. It can also boost conversions and reduce cart abandonment.

In this article, we will show you how to add express checkout buttons in WooCommerce.

How to add express checkout buttons in WooCommerce

Why Add Express Checkout in WooCommerce?

Adding express checkout to your WooCommerce store provides a better shopping experience for your customers.

It allows customers to go directly to the payment page and skip the shopping cart or checkout pages. They also won’t have to go to a payment provider page or fill out a checkout form to complete their purchases.

Express checkout buttons make the entire buying process quicker. Customers can simply click the buttons and log in to pay for the products they wish to buy in an instant. As a result, you may see a boost in conversions and fewer abandoned carts.

Adding express checkout also helps mobile users where their screen sizes are small. Customers will just tap the buttons to quickly purchase the products.

However, WooCommerce doesn’t offer an express checkout option by default. You will need to use a WooCommerce plugin to add the feature to your online store.

That said, let’s see how you can add express checkout buttons in WooCommerce.

Setting Up FunnelKit on Your WooCommerce Store

FunnelKit is the best WooCommerce sales funnel plugin on the market. It lets you add express checkout buttons and create different funnel pages for your online store.

The best thing about using the plugin is that it works with Stripe, Apple Pay, Google Pay, PayPal Express, Amazon Pay, and other payment gateways for express checkout. This way, you don’t have to add each payment provider to your online store using third-party plugins or extensions.

FunnelKit also provides user-friendly templates and lets you do A/B testing. You can easily customize your funnels using different drag-and-drop page builders. Plus, there are multiple pre-built templates and automation features for your marketing campaigns.

FunnelKit

Note: For this tutorial, we will be using the FunnelKit Pro plugin because it includes premium templates and more customization options. You can also use the free Funnel Builder for WordPress by FunnelKit plugin to add express checkout buttons in WooCommerce.

First, you will need to install and activate the FunnelKit plugin. If you need help, then you can follow our guide on how to install a WordPress plugin.

Upon activation, you will see the FunnelKit setup wizard. Go ahead and click the ‘Get Started’ button.

Start FunnelKit setup wizard

After that, you will need to enter your license key. You can find the key in the FunnelKit account area.

Simply click the ‘Activate’ button after entering the license key.

Enter FunnelKit license key

Next, FunnelKit will ask you to install essential plugins. These include WooCommerce, Stripe, FunnelKit Automations, and FunnelKit Cart.

The best part is that you just have to click the ‘Install and Activate’ button, and FunnelKit will take care of the rest.

Install essential plugins

After the plugins are active, the final step is to enter your email address.

Once that’s done, simply click the ‘Submit & Finish’ button.

Enter email and finish setup

You will now see a success message. You are ready to create funnels using the plugin and add express checkout buttons to your WooCommerce store.

Go ahead and click the ‘Go to Funnels’ button to continue.

Close the congratulations message

Enabling Payment Gateways in WooCommerce

Before moving forward, make sure you have set up at least one payment service in your WooCommerce store.

To do that, simply go to WooCommerce » Settings from your WordPress dashboard and click on the ‘Payments’ tab.

Enable payment services in WooCommerce

After that, you can click the toggle to enable the payment gateway of your choice and click the ‘Finish set up’ button to complete the configuration.

To learn more, you can follow our guide on how to allow users to choose payment methods in WooCommerce.

Adding Express Checkout Buttons to WooCommerce

Once you have enabled your preferred payment gateways, you can head to the FunnelKit » Store Checkout page from your WordPress admin panel.

From here, simply click the ‘Create Store Checkout’ button.

Create store checkout

On the next screen, FunnelKit will show you professionally-designed templates for your checkout page. It will also let you create a checkout page from scratch.

However, we recommend using a template and quickly customizing it according to your requirements.

Simply hover over a template you’d like to use and click the ‘Preview’ button.

Previewing FunnelKit's WooCommerce templates

For this tutorial, we will use the Livewire template.

Next, go ahead and click the ‘Import This Funnel’ button at the top.

Import the funnel template

Depending on the template you use, FunnelKit may ask you to install additional plugins like Elementor to edit the checkout page.

Next, you will need to enter a name for your store checkout and click the ‘Add’ button.

Enter a name for your checkout page

After that, you will see all the steps that are included in the template.

You can simply click the ‘Edit’ button for the Checkout page to continue.

Edit the checkout page

Next, you can switch to the ‘Optimizations’ tab. From here, simply enable the ‘Express Checkout Buttons’ option.

FunnelKit will also let you choose the position of the buttons from the following options:

  • Top of the checkout page
  • Before/after the product switcher
  • Before/after the order summary
  • Above the payment gateways
Enable express checkout

When you are done, simply click the ‘Save Changes’ button.

That’s it, you have successfully added express checkout buttons to your online store.

If you want to edit the appearance of the checkout page, then you can switch to the ‘Design’ tab and click the ‘Edit Template’ button.

Edit the template

You can learn more by following our guide on how to customize the WooCommerce checkout page.

Once you have made your changes, simply visit your online store to view the express checkout buttons in action.

Express checkout buttons preview

Additionally, FunnelKit helps you upsell products in WooCommerce. This way, you can boost sales by encouraging users to buy more products.

You can also set up automated emails in WooCommerce using FunnelKit Automations, a sister product of FunnelKit. This plugin lets you create automated workflows and send email campaigns to customers.

We hope this article helped you learn about how to add express checkout buttons in WooCommerce. You may also want to see our list of the best WooCommerce plugins for your store and how to create a WooCommerce popup to increase sales.

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 Add Express Checkout Buttons in WooCommerce first appeared on WPBeginner.

How to Setup Cloudflare Free CDN in WordPress (Step by Step)

Do you want to use the free Cloudflare CDN on your WordPress site?

Cloudflare is one of the best WordPress CDN services available in the market. They offer a free CDN that speeds up your website along with a suite of powerful security features for small business websites.

The challenge is that many entry-level users are not able to use Cloudflare because they think it is hard to set up.

In this guide, we will walk you through a complete Cloudflare setup in WordPress to help you improve your website speed.

How to Setup Cloudflare Free CDN in WordPress (Step by Step)

What Is a CDN?

A CDN or content delivery network is a system of distributed servers that helps deliver your website files faster to users based on their location.

Typically, a web hosting service serves your website visitors from a single location. All the users access the same server, no matter where they are located.

This can cause a delay in content delivery for users living further away from your website’s central hosting server.

That’s why CDNs set up multiple edge servers in different locations around the globe.

These CDN servers cache static content from your website’s origin server and present it to users when they visit your WordPress website.

Content Delivery Network (CDN)

When there is a user request, the CDN server closest to the user’s location will handle it.

For example, if someone in the USA wants to access a UK-hosted website, then a CDN server in the USA will serve that request, not the main server in the UK.

With a CDN, all the user requests are handled by the nearest CDN servers. This reduces the physical distance between the visitors and your website’s server.

As a result, a CDN improves your website performance and speed for all users regardless of their geographic location.

A faster website also improves the user experience and can give your website a slight boost in SEO rankings. Using a CDN also reduces the load on your primary server and protects it from crashing during traffic spikes.

If you want to learn more, then see our guide on why you need a CDN for your WordPress blog.

What Is Cloudflare CDN?

Cloudflare CDN

Cloudflare is one of the most popular free CDN providers available on the internet. It is a large network of globally-distributed servers that automatically cache static content and deliver dynamic content quickly.

On top of a CDN service, Cloudflare is also a cloud-based website firewall and a distributed proxy server. It monitors all incoming traffic to your website and blocks suspicious traffic even before it reaches your server.

They offer a free basic plan that’s suitable for small business websites and blogs. They also offer paid plans starting at $20 per month.

Cloudflare is an excellent choice for small businesses looking for a free CDN. However, if you want to fully utilize all of Cloudflare’s features, then you will need the Business plan, which costs $200 per month.

Note: We do not use Cloudflare on WPBeginner. Instead, we use Sucuri as a website firewall and CDN. This firewall has the double benefit of improving speed and security. You can learn more in our comparison of Sucuri vs. Cloudflare.

With that being said, let’s take a look at how to set up Cloudflare Free CDN in WordPress. You can use the quick links below to jump to the different parts of the tutorial:

Setting Up Cloudflare CDN in WordPress

To begin, you need to visit the Cloudflare website and click on the ‘Sign Up’ button.

Visit Cloudflare website

On the next page, you need to enter your email address and password to create a Cloudflare account.

Simply enter the information required, and then click on the ‘Sign up’ button.

Create Cloudflare account

When you finish signing up, you will see a thank you page confirming that your Cloudflare account has been set up.

The next step is to add your website to Cloudflare. You should click the ‘Add a website or application’ button to get started.

The Cloudflare Thank You Page

You can now enter your website into the ‘Enter your site’ field.

Make sure you only type your site’s domain name, such as example.com. You don’t need to type the full URL or any extra characters.

Enter Your Website's Domain Name

On the next screen, you will be asked to choose the type of Cloudflare plan you want.

For this tutorial, we will choose the free Cloudflare plan. Then, click the ‘Continue’ button.

Select Cloudflare free plan

After that, Cloudflare will show you a list of all DNS records their systems found. These will include your subdomains as well.

The DNS records you want to be passed through Cloudflare should have an orange cloud icon. The DNS records that will bypass Cloudflare will have a gray cloud icon.

You need to review the list to make sure that your primary domain is active on Cloudflare with an orange cloud icon. Simply click the ‘Proxy status’ toggle to change the status.

Verify DNS Records to Set up Cloudflare

Once you have verified your DNS records, just click on the ‘Continue’ button at the bottom.

During the next step of your setup, Cloudflare will ask you to update your nameservers. You will be asked to change your nameservers and point them to Cloudflare nameservers.

Change to Cloudflare nameservers

Note: Changing nameservers can take some time to propagate throughout the internet. During this time, your website may become inaccessible to some users.

You can change nameservers from your domain registrar account, like Domain.com.

Or, if you got a free domain from your web hosting provider like Bluehost, then you will have to change the name server by logging in to your hosting account.

For the sake of this tutorial, we will be showing you how to change the nameservers from the Bluehost control panel.

While the process is similar across hosting companies, you can always ask your hosting provider for detailed instructions for their control panel.

Once you are logged in to your Bluehost cPanel dashboard, go to the ‘Domains’ section, and select your domain name. After that, click on the ‘Name Servers’ tab and the ‘Edit’ button.

Edit nameservers in hosting cPanel

Next, you need to select ‘Custom’ and enter the nameservers provided by Cloudflare.

Then, click the ‘Save’ button.

Save new Cloudflare nameservers

After that, you need to go back to the Cloudflare setup page, and click the ‘Done, check nameservers’ button to finish the setup.

It will now check your new nameservers automatically.

Check Cloudflare nameservers

That’s it! It will take a few minutes to update your domain nameservers and activate Cloudflare.

Once activated, you will see the success message in your Cloudflare dashboard.

Cloudflare success message

In the meantime, the Cloudflare Quick Start Guide will open automatically, and you can use it to customize your Cloudflare settings. We will show you how in the next section.

Note: The above screenshots show the Bluehost control panel. Your nameserver settings may look different if you are using a different hosting provider.

Configuring Cloudflare With the Quick Start Guide

The Cloudflare Quick Start Guide should have opened automatically after you clicked on the ‘Done, check nameservers’ button above. This setup wizard will help you improve the security and performance of your website.

The first setting is ‘Automatic HTTPS Rewrites’.

Cloudflare Automatic HTTPS Rewrites

This will help you avoid the mixed content error in WordPress. It does this by automatically changing ‘http’ to ‘https’ in the URLs of all resources and links on your site that can be served with a secure ‘https’ URL.

This setting is on by default. We recommend you leave it on and click the ‘Save’ button.

The next setting is ‘Always Use HTTPS’.

Always Use HTTPS

Some users have reported issues when using this setting with Cloudflare. This setting is disabled by default, and we recommend you leave it that way. We will show you how to redirect from HTTP to HTTPS using the All in One SEO plugin later in this article.

Now you can click the ‘Save’ button to move on to the next option.

The next setting is Brotli compression.

Brotli Compression

Cloudflare can use Brotli compression to unlock 15-20% speed improvements. This setting is on by default, and we recommend you leave it on.

Make sure you click the ‘Save’ button to store this setting.

Now you will see a summary of what you have configured with the Quick Start Guide.

Cloudflare Quick Start Summary

You should see:

  • Automatic HTTPS Rewrites: ON
  • Always Use HTTPS: OFF
  • Brotli: ON

You have now completed the Quick Start Guide and can click the ‘Finish’ button. However, there are still some additional important settings that need to be configured.

Configuring Additional Important Cloudflare Settings

Your basic Cloudflare setup is complete, but there are a few essential settings you need to configure to keep your WordPress site secure.

1. Secure Your WordPress Login Page

You can set up page rules to customize how Cloudflare works on specific pages on your site. This is especially useful for securing critical pages such as the login page and wp-admin area.

The Cloudflare free account allows you to set up 3 page rules. If you want to add more page rules, then you need to pay $5 per month for 5 extra rules.

First, you need to click the ‘Rules’ option in the menu on the left of the page. After that, you can click the ‘Create Page Rule’ button.

Cloudflare Page Rules

Now you can set up 3 different page rules. You can start by creating a rule that secures your WordPress login page.

Simply add the following settings below to secure your website:

  • Page URL: example.com/wp-login.php*
  • Settings: Security Level – High
Secure WordPress login page

When you are done, just click ‘Save and Deploy’ to store and activate the rule.

2. Exclude the WordPress Dashboard from Cloudflare

You will be returned to the Page Rules page, where you can see your first rule listed.

Now you can create a second rule to exclude the WordPress dashboard from Cloudflare caching and enable high security.

Click the Create Page Rule Button

You’ll need to click on the ‘Create New Rule’ button to create your second rule.

After that, you need to type the following settings into the rule. You can click the ‘+ Add a Setting’ button to add new rows for additional settings:

  • Page URL: example.com/wp-admin*
  • Settings: Security Level – High
  • Cache Level – Bypass
  • Disable Performance
  • Disable Apps
Exclude WordPress dashboard

When you are done, make sure you click ‘Save and Deploy’ to add the new rule.

3. Configure SSL Certificate Settings

Another important setting is the SSL certificate available in the ‘SSL/TLS’ menu on the left.

Set SSL certificate settings

Make sure to click the ‘Full’ radio button if you are already using SSL.

If you don’t have an SSL certificate, then see our guide on how to get a free SSL certificate for your website.

Once you are done, Cloudflare will provide the essential green padlock in your visitors’ address bar to signify that your website is secure.

4. Redirect from HTTP to HTTPS Using All in One SEO

We mentioned earlier that we don’t recommend using Cloudflare’s ‘Always Use HTTPS’ feature. A great alternative is to use the All in One SEO plugin. It’s the best SEO plugin for WordPress, used by over 3 million sites.

The first thing you need to do is activate and install the All in One SEO plugin. For more details, see our guide on how to install a WordPress plugin.

After that, navigate to All in One SEO » General Settings and then enter your license key into the ‘License Key’ box and click ‘Connect’.

Enter AIOSEO license key

You can find your license key in your account profile on the All in One SEO website.

Next, navigate to All in One SEO » Redirects and then click the ‘Full Site Redirects’ menu navigation option.

AIOSEO Full Site Redirect

You will need to scroll down the page until you find the ‘Canonical Settings’ toggle. You should click this toggle so that it turns blue.

Next, turn on the ‘Redirect from HTTP to HTTPS’ toggle. This will create a redirect from HTTP to HTTPS, making sure that your visitors always have a secure connection to your website.

Using AIOSEO to Force HTTPS

When you are done, make sure to click the ‘Save Changes’ button at the bottom or top of the screen to store this setting.

Optimizing Cloudflare for WordPress Using a Plugin

Cloudflare offers a dedicated WordPress plugin for one-click WordPress-optimized settings.

The plugin lets you quickly set up Cloudflare on your WordPress site, add web application firewall (WAF) rulesets, automatically purge the cache, and more.

To get started, install and activate the Cloudflare plugin on your website. For more details, see our step-by-step guide on how to install a WordPress plugin.

Once done, you need to visit Settings » Cloudflare in your admin panel to configure the Cloudflare settings.

On the settings page, you will see a ‘Create Your Free Account’ button and a sign-in option for existing accounts. Simply click the ‘Sign in here’ link.

Cloudflare plugin settings

On the next screen, you will need to enter your Cloudflare email and API key.

Click the ‘Get your API key from here’ link.

Entering API Credentials Into the Cloudflare Plugin

This will bring up a popup for your account area on the Cloudflare website.

Make sure you are on your ‘My Profile’ page, and then click on the ‘API Tokens’ tab in the left sidebar.

After that, go to the ‘Global API Key’ section and click on the ‘View’ button.

Get global API key

This will open a popup and display your API key.

Simply click on the key to copy it.

Click to Copy the Global API Key

Next, you need to come back to your WordPress dashboard and enter your email address and API key.

Then, click the ‘Save API Credentials’ button.

Save Cloudflare API Credentials in WordPress

After that, the Cloudflare settings will appear on your dashboard.

From here, you can apply a single-click WordPress optimization, purge the cache, enable automatic cache, and more.

To optimize your WordPress site, just click the ‘Apply’ button next to ‘Apply Default Settings’.

Apply to optimize WordPress

Next, click on the ‘Settings’ menu option.

Here you will find more site optimization settings.

Cloudflare for WordPress Settings

You can scroll down on this screen to find the ‘Security’ section.

By default, the security level is medium. To improve your website’s security, you can select ‘High’ from the dropdown list.

Change WordPress security level

We hope this article helped you to learn how to set up Cloudflare free CDN in WordPress. You may also want to see our ultimate WordPress security guide and our expert picks for the best WordPress security plugins to further protect 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 Setup Cloudflare Free CDN in WordPress (Step by Step) first appeared on WPBeginner.

How to Disable Automatic Update Email Notification in WordPress

Do you want to disable automatic update email notifications in WordPress?

By default, WordPress sends email notifications for automatic updates of WordPress plugins, themes, and the core itself. These notification emails can get annoying.

In this article, we will show you how to easily disable automatic update email notifications in WordPress.

Disabling automatic update email notifications in WordPress

About Automatic Update Notifications in WordPress

WordPress is an open-source content management platform that is regularly maintained and updated.

Some of these updates are automatically installed, and you will receive an email notification that your site has been updated.

Email notification preview after an auto-update

Similarly, WordPress also allows you to enable automatic updates for WordPress plugins and themes. This means that you can spend less time updating plugins and more time growing your business.

You can enable automatic updates for plugins that you trust by visiting the Plugins » All Plugins page in your WordPress admin dashboard.

Simply click on the ‘Enable auto-updates’ link next to the plugin that you want to update itself.

Enable automatic updates for WordPress plugins

For WordPress themes, you can visit the Appearance » Themes page and click on a theme.

This will bring up a theme information popup where you must click on ‘Enable auto-updates’.

Enable theme auto-updates

WordPress will send you an email notification when any of your plugins, theme, or WordPress core is updated.

This can get annoying, particularly for users who manage multiple WordPress websites. Wouldn’t it be nice if you could control and turn off these email notifications?

Let’s take a look at how to easily disable automatic update email notifications in WordPress. You can use the quick links below to jump to the method you want to use:

Method 1: Disable Automatic Update Email Notification Using Code (Recommended)

This method requires you to add code to your WordPress files. If you haven’t done this before, then take a look at our beginner’s guide on pasting snippets from the web into WordPress.

You can manually add the code below to your theme’s functions.php file. But this can be tricky since a mistake can bring down your whole website. Plus, if you update your theme, then any custom code snippets will be erased.

We will show you a better approach below, which is using a code snippets plugin.

1. Disable Auto Update Notification Emails for WordPress Core, Themes, and Plugins

Luckily, there is an easy and safe way to disable auto update notification emails in WordPress, and that’s using the WPCode plugin.

WPCode WordPress code snippets plugin

WPCode lets you easily add custom code snippets in WordPress without editing your theme’s functions.php file.

Plus, it has a full code library inside the plugin that includes ready-to-use, verified code snippets for popular feature requests like disabling automatic update emails, removing the WordPress version number, disabling comments, and more.

First, you need to install and activate the free WPCode plugin. For step-by-step instructions, see our tutorial on how to install a WordPress plugin.

Once the plugin is activated, you need to go to Code Snippets » Library from your WordPress admin dashboard.

Then, search for the ‘Disable Automatic Updates Emails’ snippet and click on the ‘Use snippet’ button.

Search for the Disable Automatic Updates Emails snippet in WPCode

WPCode will then automatically add the code and set the proper insertion method.

The snippet has three filters, with one for each type of auto-update email: WordPress core, WordPress plugins, and WordPress themes.

Disable Automatic Updates Emails snippet in WPCode

If you don’t want to use a particular filter, simply add a // at the beginning of the filter line.

For example, if you still want to get auto-update emails for WordPress plugins, add a // to the plugin, and the filter will stop it from executing.

Edit filters you don't want to execute in WPCode

After that, all you have to do is toggle the switch from ‘Inactive’ to ‘Active’.

Then, click the ‘Update’ button.

Switch the code snippet to Active and click Update in WPCode

Now you will no longer get automatic update emails from WordPress.

2. Disable Auto Update Notification Emails for Core Updates

You can also use WPCode to disable notification emails for automatic WordPress core updates. Instead of choosing an existing code snippet, you will need to add this code as a custom snippet:

add_filter( 'auto_core_update_send_email', 'wpb_stop_auto_update_emails', 10, 4 );

function wpb_stop_update_emails( $send, $type, $core_update, $result ) {
if ( ! empty( $type ) && $type == 'success' ) {
return false;
}
return true;
}

For more instructions, you can see our guide on how to add custom code in WordPress.

3. Disable Auto Update Notification Emails for Plugins

Just add the following code to disable notification emails for automatic updates of WordPress plugins:

add_filter( 'auto_plugin_update_send_email', '__return_false' );

4. Disable Notification Emails for WordPress Theme Updates

Finally, you can add the following code to disable notification emails for automatic updates of WordPress themes:

add_filter( 'auto_theme_update_send_email', '__return_false' );

Method 2: Disable Automatic Update Email Notification Using a Plugin

Next, we will show you how to disable automatic update email notifications using two different email plugins.

1. Manage Notification Emails

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

Upon activation, you need to visit the Settings » Notification emails page. This is where the plugin allows you to manage all WordPress notification emails, including auto-update notifications.

Disable email notifications

Simply scroll down to the auto-update options and uncheck the box next to the notifications you want to disable.

Finally, don’t forget to click on the ‘Save Changes’ button to store your settings.

2. WP Mail SMTP

Another plugin you can use to disable automatic update email notifications is WP Mail SMTP. It’s the best SMTP service for WordPress and ensures your emails are delivered to your inbox.

WP Mail SMTP lets you easily manage the emails sent by WordPress through its Email Controls. However, you will need the WP Mail SMTP Pro license to unlock the Email Controls option.

Next, you will need to install and activate WP Mail SMTP Pro on your website. You can check out our guide on how to install a WordPress plugin for more details.

Once the plugin is active, navigate to WP Mail SMTP » Settings from your WordPress admin panel and click the ‘Email Controls’ tab.

After that, scroll down to the ‘Automatic Updates’ section and disable email notifications for plugins, themes, WP core status, and full log.

Disable Update Email Notifications in WP Mail SMTP

When you are done, don’t forget to click the ‘Save Settings’ button.

That’s all. You have successfully disabled WordPress auto-update email notifications for your website.

Rolling Back WordPress Updates if Something Goes Wrong

Because WordPress plugins run on many independent WordPress hosting and server configurations, sometimes a plugin update may break a feature on your website or make it inaccessible.

This is easy to troubleshoot and fix. First, you need to figure out which plugin has caused the issue by deactivating all WordPress plugins and reactivating them one by one.

Once you have isolated the plugin causing the issue, you can use the WP Rollback plugin. It allows you to switch to the previous version of a WordPress plugin or theme.

For details, you can see our guide on how to roll back WordPress plugins and themes with step-by-step instructions.

Improving WordPress Email Deliverability

Even if you disable WordPress auto-update emails, there are other WordPress notification emails that you may not want to miss.

For instance, if you run a WooCommerce store, then you will want to receive notifications when a new order is placed.

Similarly, if you sell an online course or run a membership website, then you might want to receive email alerts when new users sign up.

You will also want to make sure that emails sent to users are delivered, including forgotten password emails, payment receipt emails, and order confirmation notifications.

To send emails, WordPress uses the PHP mail function. This function is easily misused by spammers, and your emails may end up in the spam folder.

To make sure all your important WordPress notification emails reach your users’ inboxes, you will need a proper SMTP service to send emails.

This is where the WP Mail SMTP plugin comes in. It uses an SMTP service to send all your WordPress notification emails.

You can use it with a paid SMTP service provider or a free SMTP service like Gmail combined with the free version of the WP Mail SMTP plugin.

For more details, see our guide on How to set up WP Mail SMTP on your WordPress site.

We hope this article helped you learn how to disable automatic update email notifications in WordPress. You may also want to see our guide on how to get a free business email address and our comparison of the best email marketing services to grow your sales.

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 Disable Automatic Update Email Notification in WordPress first appeared on WPBeginner.

How to Create a Mailchimp Subscribe Form in WordPress With Custom Fields

Are you looking to add a Mailchimp subscribe form to your WordPress website?

Mailchimp is a popular email marketing tool that offers a form builder. However, this builder has limited features and customization options. Adding a custom subscribe form gives you more flexibility and helps grow your email list.

In this article, we will show you how to create a Mailchimp subscribe form in WordPress with custom fields.

How to create Mailchimp subscribe form in WordPress

Why Add a Custom Mailchimp Subscribe Form in WordPress?

Adding a subscription form to your WordPress website is a great way of communicating with your users.

You can send newsletters, new product releases, announcements, and other information while creating a direct connection with your audience.

Mailchimp is one of the most popular email marketing services. It helps you build an email list, send emails, and set up automated email campaigns. Plus, it also offers a form builder that you can use to create a subscription form and embed it on your website.

However, Mailchimp’s form builder is very basic and doesn’t offer a lot of customization options. You get limited form fields to choose from, and there are no settings to change color, font, and more. It also adds Mailchimp branding at the bottom.

Mailchimp subscribe form preview

Creating a custom Mailchimp subscribe form gives you more flexibility and control. You can add all types of form fields, edit their appearance, add conditional logic to show fields based on the user’s responses, and more.

That being said, let’s look at how you can create a Mailchimp subscription form with custom fields.

How to Create a Mailchimp Subscribe Form in WordPress

The easiest way of adding a Mailchimp subscribe form in WordPress is by using WPForms. It is the best contact form plugin for WordPress that’s used by over 5 million professionals.

WPForms is a beginner-friendly plugin that offers a drag-and-drop form builder, prebuilt templates, and lots of customization options. The best part is it easily integrates with Mailchimp.

Note: For this tutorial, we will be using the WPForms Pro version because it includes the Mailchimp addon and custom form fields. There is also the WPForms Lite version that is available for free, but it doesn’t offer a Mailchimp integration.

Step 1: Connect Mailchimp With WPForms

First, you will need to install and activate the WPForms plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, you will need to go to WPForms » Settings and add the license key. You can find the key in your WPForms account area.

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

Adding a license key to the WPForms form builder plugin

Next, you will need to install the Mailchimp addon.

You can do that by going to WPForms » Addons from the WordPress admin panel. From here, navigate to the Mailchimp addon and click the ‘Install Addon’ button.

Install Mailchimp addon

The addon should now install and activate.

Once that’s done, simply go to WPForms » Settings from your WordPress dashboard and switch to the ‘Integrations’ tab.

Integrate MailChimp with WPForms

Next, you can expand the Mailchimp settings and then click the ‘+ Add New Account’ button under Mailchimp.

As soon as you do that, you will see more options. To integrate Mailchimp, you must enter the API key and account nickname. This will allow WPForms to communicate with your Mailchimp account.

See more Mailchimp integration options

Creating Mailchimp API Keys for WPForms Integration

To create an API key to connect WPForms, you will first need to log in to your Mailchimp account.

Once you are logged in, simply click on your avatar in the top right corner and select the ‘Account & billing’ option.

Click your Mailchimp avatar

On the next page, you will see different account settings.

Simply click the ‘Extras’ dropdown menu and then select the ‘API keys’ option.

Open API keys page

Next, you can copy an existing API key to use for your WPForms integration.

If you haven’t generated a key previously, then simply click the ‘Create A Key’ button.

Create a new key

After that, you can enter a name for your new API key.

Once that’s done, just click the ‘Generate Key’ button.

Enter a name for API key

Next, you will see the new API key.

Go ahead and copy the key and click the ‘Done’ button.

Copy the API key

You can now return to the browser tab or window with your WPFroms integration settings.

From here, simply paste the key into the ‘API Key’ field. You can also add a Mailchimp account nickname to remember which account you are connected to.

Enter your Mailchimp API key

After entering the key, go ahead and click the ‘Connect to Mailchimp’ button.

You should now see a green ‘Connected’ button next to the Mailchimp settings, showing that the email marketing tool is successfully integrated with WPForms.

See Mailchimp connection

Step 2: Design a Mailchimp Subscribe Form With Custom Fields

Now that you have integrated Mailchimp with WPForms, the next step is to create a subscription form with custom fields.

First, you will need to go to WPForms » Add New from the WordPress dashboard. Next, you can enter a name at the top and select a form template.

Select a form template

WPFomrs offers lots of prebuilt form templates, so you can quickly pick one and customize it.

It even offers form templates for Mailchimp. For instance, you can create a signup contact form, newsletter signup form, or email marketing form.

Mailchimp form templates

For this tutorial, we will choose the Mailchimp Newsletter Signup Form template.

On the next screen, you will see the WPForms drag-and-drop form builder. Here, you can customize the form and add custom fields from the menu on the left.

Add custom form fields

The default form template will come with a Name and Email field.

However, you can simply drag any form field and drop it onto the template. There are fields to add text, dropdown options, multiple choice, phone number, address, date and time, website, password, and more.

For instance, if you are using a business phone service, then you can add a Phone field. This will help you send SMS messages or reach out to subscribers via phone calls.

Adding custom form fields

You can add a checkbox field and allow users to select their interests. This way, you can segment your subscribers and send them targeted emails.

Next, you can further edit each form field in the template. Simply choose a field, and you will see more options in the left panel.

For example, we changed the options in the Checkboxes form field.

Customize each form field

You can also edit the label of the form field, make it a required field, add images to the checkbox options, and more.

Once you have finished adding custom form fields, switch to the ‘Settings’ tab from the left menu. In the General settings, you can change the form’s name and description, add tags, edit the submit button text, and more.

General form settings Mailchimp

Next, you can switch to the ‘Confirmations’ tab and choose what subscribers will see once they submit a form.

WPForms lets you show a message, a specific page like a thank you page, or redirect users to a URL.

Confirmation settings Mailchimp form

After that, you can go to the ‘Marketing’ tab from the left panel and then select Mailchimp.

From here, simply click the ‘Add New Connection’ button.

Add new Mailchimp connection

Next, a small popup will open where you will need to enter the Mailchimp nickname.

After entering it, go ahead and click the ‘OK’ button.

Enter connection nickname

Next, you can pick the Mailchimp account that you connected to earlier.

Simply click the ‘Select Account’ dropdown menu and choose your account.

Select your Mailchimp account

After that, more options will appear.

You can go ahead and select the audience from the dropdown menu to which the new subscribers will be added.

Select audience and action

There are different actions to choose from, but we will select the ‘Subscribe’ option for this tutorial. This will add the user as a new contact to your Mailchimp account.

Next, you can scroll down to see additional settings. For instance, there is an option to choose the WPForms field where users can enter their email addresses.

Additional Mailchimp settings in WPForms

You also have options to add tags to new subscribers and a note to the user’s profile.

If you scroll down further, then you will see more optional settings. For instance, you can enable double opt-in, mark the subscriber as VIP, update their profile if the contact is already in an audience, and more.

More Mailchimp settings in WPForms

Now, you are ready to add your Mailchimp subscribe form to your WordPress blog or website.

In the WPForms form builder, you will see an ‘Embed’ option at the top. Go ahead and click on the ‘Save’ button to store your changes, and then click the ‘Embed’ button.

Save and embed your form

Next, a popup will open where you will need to select an existing page or create a new page.

For this tutorial, we will use the ‘Create New Page’ option.

Embed a form in page

After that, you will need to enter a name for your new page.

Once that’s done, simply click the ‘Let’s Go!’ button.

Enter name for form embed page

Next, you will see a preview of your form in the WordPress content editor.

You can then click the ‘Publish’ button at the top to make your Mailchimp subscribe form live.

View preview of subscribe form

You have now successfully created a Mailchimp subscribe form with custom fields.

You can go ahead and visit your website to see the form in action.

Mailchimp subscribe form with custom fields preview

You can also do a lot more with Mailchimp and WordPress. For instance, you can integrate it with OptinMonster and show your subscribe forms in popup campaigns.

To learn more, please see our ultimate guide to using Mailchimp and WordPress.

We hope this article helped you learn how to create a Mailchimp subscribe form in WordPress with custom fields. You may also want to see our guide on easy ways to grow your email list faster and our expert picks for the must have WordPress plugins 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 Create a Mailchimp Subscribe Form in WordPress With Custom Fields first appeared on WPBeginner.

How to Restrict Content on WordPress to Patreon Members

Do you want to restrict content on WordPress to Patreon members?

By adding patron-only content to your website, you can encourage visitors to join your Patreon and increase your profits. It’s also a great way to get Patreon users to visit your website, which will boost your traffic and can increase revenue further.

In this article, we will show you how to restrict content on WordPress to Patreon members.

How to restrict content on WordPress to Patreon members

Why Restrict Content on WordPress to Patreon Members?

If you are a content creator, then you may want to earn money from your writing, music, podcasts, stock photos, and other content.

Patreon allows you to sell memberships and then give those people access to different content based on their subscriptions.

Patreon is also a great way to build relationships with your fans. For example, you can automatically send a welcome note to new patrons.

An example of a custom Patreon welcome note

You can also create private Discord servers or chat rooms where members can talk to each other and even message you directly.

After creating a Patreon, it’s a good idea to publish members-only content to your WordPress website. This encourages visitors to join your Patreon in order to unlock exclusive WordPress content.

This can also increase your blog traffic since patrons will need to visit your WordPress site to see the exclusive content.

That said, let’s see how you can restrict content on WordPress to Patreon members.

How to Create a Patreon Account for Your WordPress Website

If you don’t already have an account, then head over to the Patreon website and click on the ‘Create on Patreon’ button.

Creating a Patreon account for your fans

You can now type in your email address and create a password. If you prefer, then you can also register using your existing Google or Facebook login.

After entering this information, the setup wizard will ask some questions about how you plan to use Patreon. Simply follow the onscreen instructions to build an engaging and informative Patreon page.

With that done, you can use the Patreon tools to customize your page, add membership tiers, set up billing, and more.

How to create a Patreon page using the built-in tools

When you are happy with how your Patreon page looks, you are ready to add it to your WordPress website.

How to Connect WordPress to Your Patreon Account

The easiest way to create Patreon-only content is by using Patron Plugin Pro. This plugin allows you to restrict access to individual pages and posts or even lock all the content from a specific tag or category.

You can also automatically lock and unlock content based on a schedule. This allows you to create free trials, automatically drip content, and more.

First, you will need to install and activate Patron Plugin Pro. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, you will need to connect the plugin to your Patreon account. To do this, go to Patreon Settings » Patreon Settings, and then click on ‘Connect site’.

Connecting your Patreon account to WordPress

When you are ready, select ‘Start connection wizard’.

On the next screen, you need to click on ‘Let’s start!’

Connecting a WordPress website to Patreon

To connect Patreon to your WordPress website, you will need to create an OAuth client.

If you are happy to do this, then click on ‘Allow’.

How to connect Patreon and WordPress using an OAuth client

If prompted, type in the login information for your Patreon account.

After a few moments, Patron Plugin Pro will take you back to the main WordPress dashboard. Your Patreon account is now connected to WordPress.

Before you restrict any content, it’s a good idea to look at the plugin’s settings by going to Patreon Settings » Patron Settings.

The Patron Plugin Pro plugin from CodeBard

The default settings should work well for most websites, but it’s still worth checking whether you need to make any changes.

If you do customize the settings, then scroll to the bottom of the screen and click on the ‘Update Settings’ button.

Updating your Patreon settings using the Patron Pro Plugin

How to Restrict Content to Patreon Members

The easiest way to create patron-only content is by restricting access to entire content types, categories, or tags. For example, you might lock all content that has the ‘Patreon’ tag.

To do this, simply select ‘Patreon Plugin Pro’ from the left-hand menu and then click on the ‘Content Locking’ tab.

Restricting content in WordPress to Patreon members

Here, you must click to expand the ‘Make post types Patron only’ section.

To start, open the ‘Select Post Type’ dropdown and choose the content you want to restrict, such as page, post, media, or some other content type.

Restricting content categories to Patreon members

Then, open the new ‘All’ dropdown and choose whether you want to restrict this content type based on format or categories and tags.

Depending on your selection, you will get access to some additional settings. For example, if you select ‘Tag’, then you will need to choose the tag you want to make Patreon-only.

Restricting tags to Patreon members in WordPress

Finally, open the ‘Select how to lock’ dropdown and choose how you want to lock and unlock the content.

The easiest option is ‘Lock all posts of this type’. However, you can also lock the most recent example of this content and use the older content as a preview for non-members.

You can also unlock or lock content after a certain number of days has passed. This allows you to offer exclusive early access to Patreon members.

Similarly, you can use this feature to create a free trial. For example, you might make your latest online course available to non-patrons for the first 24 hours. This can create a buzz around the launch while also encouraging people to join your Patreon so that they don’t lose access after 24 hours.

Based on your selection, you will see some additional options.

Locking your WordPress content using an automated delay

Most importantly, you will need to enter a minimum $ value membership tier.

This should be linked to the cost of your memberships. For example, if your Silver tier is $5, then typing ‘$5’ will unlock this content for everyone with a Silver or higher membership.

Setting a fee for restricted content in WordPress

When you are happy with how the content locking is set up, click on ‘Add post type to gating.’

To lock more content, simply follow the same process described above. When you have finished, don’t forget to scroll to the bottom of the screen and click on ‘Save.’

How to Restrict Specific Pages and Posts to Patreon Members

Another option is to mark individual pages and posts as Patreon-exclusive. This allows you to control exactly what content your patrons have access to.

To start, simply open the page or post in the WordPress content editor.

Next, you will need to set some rules about who can access this content. In the right-hand menu, scroll to the ‘Patreon Level’ section and choose from the dropdown menu.

You can either select a Patreon level or choose ‘Any Patreon’. For example, you might select ‘Any Patreon’ if this is entry-level content that all members should have access to or if you have only created a single Patreon tier.

Restricting content based on Patreon levels in the WordPress post and page editor

Often, you will want to give new patrons access to your entire back catalog of members-only content. Another option is to restrict access to people who were already patrons when the content was published.

This is useful for creating time-sensitive Patreon promotions, such as exclusive holiday content or a ‘limited edition’ video.

To add this restriction, find the ‘Require a pledge active at the time….’ section and check its ‘Yes’ box.

Requiring an active Patreon pledge

Another option is to show or lock the content automatically based on a schedule. This is perfect for offering exclusive early access to Patreon members.

To lock and unlock content automatically, find the ‘Advanced Locking’ section. Here, open the dropdown that shows ‘No change’ by default and choose an option from the list.

Patreon's advanced content locking settings

You can then use the new settings to configure the automatic locking and unlocking.

By default, the plugin will show the following message to all non-Patreon members: ‘To view this content, you must be a member of (name) content at (cost) or more.’

Showing a message to non-patron visitors

You may want to add your own message for non-Patreon members. For example, you might say why the content is restricted or why they should buy a Patreon subscription.

To add a message, scroll to the ‘Custom Patron-Only Banner’ section and click on the ‘Non-Patrons Only’ button.

Creating a custom message for Patreon members

This adds some opening and closing tags to the small text editor.

Simply type your message in between these tags. You can also add links, formatting, and more in exactly the same way you create content in the WordPress page or post editor.

Advertising Patreon on your WordPress website

When you are happy with the settings, simply click on the ‘Publish’ or ‘Update’ button.

If you visit this content while logged into your admin account, then you won’t see any changes. However, if you visit it in an incognito browser tab, then you will see the content restriction in action.

Viewing restricted content as a non-Patron member

How to Add a Patreon Button to Your WordPress Posts

Adding Patreon-exclusive content to your WordPress blog is a great start. However, it’s also a good idea to promote your Patreon on other areas of your website. This will help turn visitors into paying patrons.

Patron Plugin Pro can automatically add a ‘Become a Patron’ button to all your posts. Visitors can simply click this button to visit your Patreon page.

Adding a Patreon button to any WordPress post

To start, select ‘Patron Plugin Pro’ from the left-hand menu, then select the ‘Quickstart’ tab.

Since we already connected the plugin to Patreon, you should see your account in the ‘Site’s Patreon user’ field.

CodeBard's Patron Plugin Pro settings

If you don’t see the right URL, then you can add it now.

After that, you are ready to configure how the call to action button acts.

By default, the plugin opens your Patreon page in the same tab. This takes visitors away from your WordPress website, so we recommend opening the link in a new tab instead.

To do this, select ‘Yes’ under ‘Open pages in new window’.

How to open a Patreon link in a new tab on your WordPress website

The plugin adds the standard Patreon button to your website by default. This helps visitors recognize the button and understand that you have a Patreon page.

If you prefer, then you customize the button with your own branding using the settings under ‘Use a custom button’. When you are happy with the changes you’ve made, don’t forget to click on ‘Save’.

Next, click on the ‘Post Button’ tab to change how the button looks.

Customizing the Patreon button on your WordPress blog or website

By default, the button includes the following heading: ‘Liked it? Take a second to support {authorname} on Patreon!’

To replace this with your own messaging, simply go ahead and type into the ‘Message over Buttons in Posts’ field.

Customizing the message above a Patreon button

You can also change the message’s alignment, adjust its size, and add margins.

If you want to remove the message instead, then find the ‘Show a message over Buttons in Posts’ section. Here, simply click the ‘No’ button.

Removing the custom message from a Patreon button in WordPress

If you make any changes, then don’t forget to click on ‘Save’.

Now, you can visit any post on your website to see the Patreon button live.

How to Add a Patreon Button to the WordPress Sidebar

If you prefer, then you can remove the Patreon button from your blog posts and add it to the sidebar or similar section instead.

In this way, you can show the button on other areas of your website, such as the product pages in your online store.

To start, you will want to remove the button from your WordPress posts so that you don’t show multiple Patreon buttons on the same page.

To do this, select the ‘Post Button’ tab and find the ‘Show Button under Posts’ section. Here, go ahead and select the ‘No’ button.

Adding a Patreon button to your WordPess website using the CodeBard plugin

With that done, click on ‘Save’.

Next, click on the ‘Sidebar Widgets’ tab. Here, you can customize the message that appears next to the button, including changing the font size and adding margins.

Adding a Patreon button to the WordPress sidebar

If you do make any changes, then don’t forget to click on the ‘Save’ button.

With that setup done, you can add the Patreon button to any widget-ready area by going to Appearance » Widgets. Here, click on the blue ‘+’ button.

Adding a Patreon block to any widget-ready area of your WordPress theme

Note: If you are using a block WordPress theme, then you will need to go to Appearance » Editor instead.

In the panel that appears, start typing in ‘Patreon Sidebar Site Widget’.

When the right block appears, drag and drop it onto the area where you want to show the Patreon button.

Promoting your Patreon to the people who visit your website

You can now type an optional title into the ‘Title’ field.

This will appear above the Patreon button in the theme’s sidebar or similar section.

Adding a title to a Patreon button WordPress

With that done, click on ‘Update’.

Now if you visit your WordPress blog or website, you will see the Patreon button in the widget-ready area.

An example of a Patreon button, on a WordPress website

Bonus: How to Create a Patreon Alternative Using WordPress

Patreon has helped countless creators monetize their content and make money online, but the platform also takes a significant cut of your earnings.

Depending on your Patreon plan, you will lose between 5%-12% of everything you earn on Patreon, plus payment processing and payout fees.

Depending on your location, you may also have to pay additional fees, including Value-added tax, Goods and services tax, Québec sales tax (QST), and US Sales tax.

All of this can really add up.

You will also need to follow all of Patreon’s terms and conditions and other guidelines. If you break any rules, then Patreon will censor your content and may even delete your account. If this happens, then paying members will lose access to your content, which reflects badly on your brand and can damage your reputation.

With that being said, many WordPress website owners are looking for a Patreon alternative.

That’s where MemberPress comes in.

The MemberPress membership plugin

MemberPress is the best membership plugin for WordPress.

It allows you to create unlimited membership levels for your WordPress website and then restrict access to your content based on the person’s membership level.

Membership tiers, in the MemberPress WordPress plugin

In this way, you can create members-only videos, eBooks, blog posts, online courses, downloadable files, and more.

You can even assign different content to different membership levels, which encourages members to upgrade their subscriptions.

Different membership levels on a WordPress members website

This is exactly how the Patreon tier model works, without any of the extra transaction fees. Since MemberPress doesn’t take a cut of your earnings, you get to keep more of the money you make.

For more on this topic, please see our detailed guide on how much it costs to start a membership site.

With MemberPress, you also have the freedom to create your own privacy policy, rules, and terms and conditions. This gives you more flexibility to create unique and engaging content for your fans, which will make it easier to grow your business.

To help you get started, we have created an ultimate guide to building a WordPress membership site using MemberPress.

We hope this article helped you learn how to restrict content on WordPress to Patreon members. You may also want to read our guide to the best social media plugins for WordPress to grow your online following and learn how to run a giveaway/contest 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 Restrict Content on WordPress to Patreon Members first appeared on WPBeginner.

How to Cloak Affiliate Links on Your WordPress Site

Are you looking for a way to cloak affiliate links on your WordPress site?

Cloaking your affiliate links in WordPress provides clean and easy-to-read links, which can increase the likelihood of clicks and conversions. It can also increase user trust.

In this article, we will show you how to easily cloak affiliate links in WordPress.

Cloaking affiliate links in WordPress

What Is Affiliate Link Cloaking, and Why Do You Need It?

Link cloaking is a technique used to make long affiliate links into shorter and branded links on your WordPress website.

Often, affiliate links are lengthy, hard to remember, and show your affiliate username or ID like this:

http://www.affiliatesite.com/products/?product_id=123&affiliate=123

With link cloaking, you can shorten your ugly affiliate links into branded URLs like this:

http://www.yoursite.com/refer/productname

This can make your links look more trustworthy and professional to your audience, encouraging more clicks.

If you use affiliate links to make money from your WordPress blog, then you should cloak links, as doing this can increase your click-through rate and conversions.

Many link-cloaking plugins will also help you measure the performance of your affiliate marketing strategies and optimize them for better results.

Cloaking affiliate links also adds an additional layer of security by masking the actual affiliate URL. This can protect your affiliate accounts and earnings from fraud or theft.

This can also help prevent your links from being blocked by social media sites or search engines, increasing the search visibility of your affiliate content.

Having said that, let’s see how you can easily cloak affiliate links on your WordPress website, step by step.

How to Cloak Affiliate Links in WordPress

There are many link-cloaking plugins that you can use in WordPress, including Pretty Links and Thirsty Affiliates. Both plugins are great, but we will use Pretty Links for this tutorial since it’s a little more beginner-friendly for this use case.

You can easily cloak affiliate links in WordPress using Pretty Links. It is one of the best affiliate marketing tools for WordPress that lets you add, manage, and cloak affiliate links.

Install and Activate Pretty Links

First, you need to install and activate the Pretty Links plugin. For detailed instructions, please see our beginner’s guide on how to install a WordPress plugin.

Note: Pretty Links also has a free version that can cloak links. However, we will be using the Pro version in the tutorial to unlock more features.

Create Your Cloaked Link

Upon activation, you need to head over to the Pretty Links » Add New page from the WordPress admin sidebar to create an affiliate link.

Once you are there, you can start by typing a name for your link into the ‘Add Title’ option.

After that, you must select a link type from the ‘Redirection’ dropdown menu to create short and branded links for your affiliate program.

If you choose ‘Cloaked’, then the target URL will be hidden in your user’s browser, and they will only see your cloaked link. Some affiliate programs don’t allow this, so you will need to check first.

Another option is ‘307 Temporary’. It will replace the original URL with your new affiliate link and tell search engines that this link may change in the future.

Add a title for your affiliate link and choose the Cloaked option as the redirection type

Next, simply copy and paste your affiliate link into the ‘Target URL’ field.

Once you have done that, type the slug you want to use for your cloaked link into the ‘Pretty Link’ field.

For example, if you want your cloaked link to be like the example below, then you will need to type the ‘/refer/bluetooth-speakers’ text into the ‘Pretty Link’ field. You will then get a link like this:

www.example.com/refer/bluetooth-speakers

Add cloaked affiliate link

Choose Attributes for Your Cloaked Link

After that, simply switch to the ‘Advanced’ tab from the sidebar on the left.

From here, you can add different attributes to your affiliate link by checking the box next to these options.

For instance, if you want to add a nofollow attribute to the external link, then simply check the box next to ‘No Follow’. This means that search engines won’t pass on any link authority to the site you are linking to.

Add attributes to the cloaked affiliate link

You can also check the ‘Sponsored’ box to tell search engines that your link is a paid advertisement.

Plus, checking the ‘Parameter Forwarding’ box can be handy if you want to pass a coupon code or customer ID to your cloaked link.

It’s also a good idea to check the box next to ‘Tracking’ so that you can view your affiliate link performance in the Pretty Links reports.

Configure Pro Settings for Your Cloaked Link

Once you have done that, you need to switch to the ‘Pro’ tab from the sidebar on the left. Now, you can set an expiry date for the affiliate link by checking the ‘Expire’ option.

This will expand a tab on your screen where you can set an expiry date for the link after a specific date or number of link clicks.

For example, if you choose the ‘Clicks’ option from the ‘Expire After’ dropdown menu and type 5 into the ‘Clicks’ field, then your affiliate link will immediately expire once 5 visitors have clicked on the link.

You can also type a URL for the expired redirect into the ‘URL’ field. This will be the link that users will be redirected to if they click on the expired affiliate link.

Set an expiry date for the cloaked affiliate link

After that, you can type the keywords that you would like to be replaced with your affiliate link into the ‘Keywords’ field.

This means that whenever the keyword you choose is written in your WordPress post or page, the plugin will automatically add its affiliate link to the keyword.

You can also easily replace another URL with your affiliate link by typing it into the ‘URL Replacements’ field.

Now, whenever Pretty Links finds this URL on your website, it will replace it with the cloaked link.

Choose a keyword and replacement URL

Once you are done, simply click the ‘Update’ button in the Publish section to store your changes.

After that, you need to click the ‘Publish’ button in the same section to publish your cloaked affiliate link.

Save affiliate link

Add Your Cloaked Link to a WordPress Post or Page

Now, you can visit a WordPress post or page where you want to add the cloaked affiliate link.

Once you are there, simply select the text that you want to link on top of and then click the ‘Pretty Links’ icon in the block toolbar at the top.

This will open up a link prompt on your screen, where you can search for the cloaked affiliate link using its title or the link itself.

Add affiliate link in the block editor

Upon adding the link, just click the ‘Publish’ or ‘Update’ button at the top to store your settings.

Now, you can visit your website and click on the affiliate link. You will now see the cloaked URL redirecting you to the affiliate product page.

Preview for cloaked links

We hope this article helped you learn how to easily cloak affiliate links in WordPress. You may also want to see our tutorial on how to create an affiliate product box in WordPress and our expert picks for the best WordPress themes for affiliate marketing.

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 Cloak Affiliate Links on Your WordPress Site first appeared on WPBeginner.

How to Start a Blog in WordPress

Do you have something worthy on your mind to share with the world today? Absolutely the best way to go about it is to pen your thoughts in the right direction on the right platform that can help you reach out to the very people who would love to read your piece d’art! What better [...]

Read More...

The post How to Start a Blog in WordPress appeared first on Learn WordPress with WPLift.

How to Add a Contact Form Popup in WordPress

Are you looking for an easy way to show a contact form popup on your WordPress website?

Contact forms are great for communicating with your visitors. Placing them in a popup makes it even easier for your customers to contact you about your products and services.

In this article, we will show you how to add a contact form popup in WordPress.

How to add a contact form popup in WordPress

Why Use a Contact Form Popup?

Every WordPress website or blog needs a contact form so users can reach out with questions, feedback, or problems.

However, if your contact form is only on a single page, then it’s hard for people to find it.

As a result, your users may end up leaving your site before contacting you, and you could lose potential leads and conversions.

A contact form popup helps solve this issue by allowing your visitors to quickly view the form by clicking a button, so they can get in touch with you from whatever page they’re on.

It helps keep people on your website, as they don’t have to exit the page they are viewing. You can also grow your email list using a contact form popup.

That said, you will first need to create a contact form and then place it in a popup to display on your web pages. Don’t worry, we will guide you on creating a contact form and adding it to a popup in WordPress.

How to Create a WordPress Contact Form

First, you will need to select a WordPress contact form plugin.

There are many free and paid options you can choose from, but we recommend using WPForms as it’s the best option.

WPForms is a beginner-friendly form plugin and offers a drag & drop builder that allows you to create a contact form in WordPress in just a few clicks. It also offers prebuilt form templates and lots of customization options.

For this tutorial, we will use the WPForms Lite version because it is free and offers a contact form template.

However, you can also use its premium version to unlock more features. For instance, WPForms Pro offers multiple form templates, more customization options, powerful addons, and lets you collect online payments.

To start, you will first need to install and activate the WPForms Lite plugin. If you need help, then see our step-by-step guide on how to install a WordPress plugin.

Once the plugin is active, you are now ready to create your contact form. All you have to do is go to WPForms » Add New from your WordPress dashboard.

Add a new form

After that, WPForms will ask you to enter a name for your form and select a template.

Go ahead and select the ‘Simple Contact Form’ template.

The WPForms Simple Contact template

Next, you can add fields in the form using the drag-and-drop builder.

Simply drag the fields you want to add to the form from the options given in the menu on your left. You can also reorder the positions of each field in the form.

A contact form template

WPForms also lets you customize each field in the contact form.

For example, if you click on the Name field, then you’ll get different options, such as changing its label and format. You can even add a description or mark any field as required.

Edit each field in the contact form

Once you are done, go ahead and click the ‘Settings’ option to configure the form notification and confirmation.

In the General settings, you can rename the form, change the submit button text, enable anti-spam protection, and more.

Editing the WPForms settings

Next, you can go to the Notifications settings option. By default, the notifications are sent to the admin email that is set up on your WordPress website.

However, you can send your contact form notification to any email address you want. If you wish to receive notifications on multiple emails, then separate each email with a comma.

For the email subject line, WPForms uses the form name you entered earlier. However, you can edit the text of the subject line to whatever you wish.

Edit notification settings

After that, go ahead and click the Confirmations option.

WPForms will use ‘Message’ as the default confirmation type, where your visitors will see a thank you message upon submitting a form.

Edit form confirmation settings

However, you can change the message type and redirect users to a specific page on your website when they complete a form.

Once you are done creating a contact form, make sure to click the ‘Save’ button at the top right corner to save your changes.

Embed your form

Next, click the ‘Embed’ option in the top corner next to the Save button.

When a new window appears, select the ‘use a shortcode’ option.

Click the use a shortcode link

WPForms will display a shortcode for your contact form as soon as you click the link. We suggest that you keep this tab/window open as you will need it in the next step, where we’ll show you how to add your contact form in a popup.

Add a Contact Form Popup to Your WordPress Site

To create a contact form popup, you will need a WordPress popup plugin.

We recommend using OptinMonster as it is the best lead generation and conversion optimization plugin for WordPress. Over 1.2 million websites use the powerful tool.

For this tutorial, we will use the OptinMonster Pro version, which includes a clutter-free template and advanced display rules to show the popup.

You will first need to sign up for an account by going to the OptinMonster website. Simply visit the website and click the ‘Get OptinMonster Now’ button.

OptinMonster

Next, you will need to install and activate the free OptinMonster plugin on your website. For more details, follow our guide on how to install a WordPress plugin.

After the plugin is active, you will see the setup wizard. Go ahead and click the ‘Connect Your Existing Account’ button.

Connect your existing account

A popup window will now appear, and OptinMonster will ask to connect to your account.

Simply click the ‘Connect To WordPress’ button.

Connect OptinMonster to WordPress

Now that your account is connected, the next thing is to create a new campaign for your contact form popup.

You can start by going to OptinMonster » Campaigns and then clicking the ‘Create Your First Campaign’ button.

Create first OptinMonster campaign

On the next screen, you will have to select a campaign type.

Since we will create a contact form popup, select ‘Popup’ as your Campaign Type.

Choose a campaign type and template

After that, scroll down to choose a template for your popup. OptinMonster offers over 75 attractive and highly converting designs for your popups.

You can select any template that you like. Next, enter a name for your campaign and click the ‘Start Building’ button.

Enter a name for your campaign

Now using the drag-and-drop builder in OptinMonster, you can edit your popup template.

You will now see different Blocks appear in the menu on your left. Simply head over to the ‘WPForms’ block and drag and drop it on your template.

Add the WPForms block in popup

After that, you’ll need to click the ‘Form Selection’ dropdown menu from the block settings in the left menu and select the ‘Add Shortcode Manually’ option.

From here, enter your WPForms contact form shortcode in the block. To find the code, go back to your WPForms embed settings and copy the shortcode.

Enter contact form shortcode

An important thing to note is that you won’t see a preview of the contact form in the template when you add the shortcode.

This is normal, as your contact form will appear when the campaign is published.

See contact form shortcode

Next, you can go to the Display Rules tab at the top to choose when the popup should appear on your website.

By default, OptinMonster will set it to when the time on the page is 5 seconds, and the popup will appear on any page.

However, you can change the display rule settings and select different triggers and targeting options.

We suggest using the MonsterLink (On Click) targeting. This way, your popup will appear when a visitor clicks a link or a button.

Select MonsterLink display rule

After that, you can click the ‘Copy MonsterLink Code’ button and add it to any text, image, or button on your website.

For more details, you can follow our beginner’s guide on how to add a link in WordPress.

Copy the MonsterLink code

Your MonsterLink code will look like this in HTML:

<a href="https://app.monstercampaigns.com/c/ep6f5qtakxauowbj8097/" target="_blank" rel="noopener noreferrer">Subscribe Now!</a>

However, to embed the link on your WordPress blog post or page, you just need the URL from the code.

https://app.monstercampaigns.com/c/ep6f5qtakxauowbj8097/

For example, let’s say you want to add a contact us button on your site. You can start by editing any page or post and go to your WordPress editor. Next, click the (+) plus sign at the top and add a ‘Buttons’ block.

Add a button block

After that, you can enter a text for your button and then click the link icon.

Now add the MonsterLink URL to your button.

Enter the MonsterLink in the button

Once you have done that, publish your WordPress post or page. The MonsterLink will now be added to your contact us button.

Next, head back to your OptinMonster campaign to complete the configuration.

After selecting MonsterLink as your target and showing it on any page, you can click the ‘Next’ button at the bottom.

Complete display rules setup

On the next screen, you will see options to change the campaign view type, add a MonsterEffect animation, and play a sound when the popup appears.

Go ahead and click the ‘Next’ button when you are satisfied with the settings.

Setup additional display rule settings

After that, OptinMonster will show a summary of your Display Rule settings.

This helps to ensure you have correctly set up when your campaigns will appear on your website.

View display rules summary

Now, you are ready to take your campaign live and publish your contact form popup. To do that, go to the ‘Publish’ tab at the top.

Next, you can click the ‘Preview’ button before publishing your campaign. This will show you a live preview of how your popup will look on your website.

When you are happy with the appearance of your campaign, change the ‘Publish Status’ from Draft to Publish.

Change the publish status

You can exit the OptinMonster campaign builder and check the status of your campaign from your WordPress dashboard as well.

Simply click the ‘Status’ dropdown menu on your right and change the status from Pending to Published.

Change the campaign status

Don’t forget to save the changes.

Next, go to the contact us button you created earlier with MonsterLink and see the contact form popup in action.

Contact form popup preview

We hope this article helped you learn how to add a contact form popup in WordPress. You may also want to check out our guide on how to choose the best website builder or our comparison of the best payroll software 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 Add a Contact Form Popup in WordPress first appeared on WPBeginner.