WordPress – How to Restrict Access to Landing Pages by Date

In this tutorial, we show you how to restrict access to landing pages by date. In other words, we will show you how to make your potential customers able to access landing pages for a certain date range or on a specific date.

What is a landing page and what’s its utility?

A landing page is very useful to promote your products or services and call potential customers to action. If you are a professional who offers a service, a landing page with prices and contact numbers is great for you. If you sell plugins or any other content on the internet, a landing page is the best way to present your platform to the world and sell more.

Problem and solution to restrict access to landing pages by date

To restrict access to your landing pages by date, you would normally have to apply those changes by programming each date and page using snippets, which can be very confusing or impossible to use for someone who knows nothing about programming.

Fortunately, with the WordPress Conditional Post Restrictions plugin, you can apply conditional restrictions to your posts, pages, and any other custom post types created by other plugins such as events, courses, downloads, products, etc.

To restrict access to landing pages by date, you need to follow these simple steps:

1- Install the “WordPress Conditional Post Restrictions” plugin

You can download the plugin here:

Download WordPress Conditional Post Restrictions Plugin - or - Read more

After installing and activating the plugin, you can proceed to restrict access to landing pages by a specific date or date range.

2- Restrict access to landing pages by date

First, we’ll restrict access to landing pages by date. This means that users will be able to access that landing page on the selected date only.

You need to take these simple steps:

  1. Go to Pages in wp-admin.
  2. Open the landing page you want to edit.

Once you open the landing page you want to edit, scroll down to the Restriction rules section on the WordPress classic or Gutenberg page editor.

Once on the Restriction rules section, you need to select the following values to restrict access to landing page by date:

restrict access to landing pages by date

  • Enable content restrictions: Yes
  • What happens when the conditions are met: Allow access
  • Condition 1: Date (YYYY-MM-DD) = 2020-10-15
  • Update the page to save the changes.

Important:

  1. You decide on which date you want to restrict access to your landing pages.
  2. You need to repeat the same steps with the other pages you want to restrict by a specific date.

3- Restrict access to landing pages by date range

Now, we’ll restrict access to our landing pages using a specific date range. This means that users will be able to access the selected landing page during the date range we select; for example, we’ll allow access during December 2020.

You need to take these simple steps:

  1. Go to Pages in wp-admin.
  2. Open the landing page you want to edit.

Once you open the landing page you want to edit, scroll down to the Restriction rules section on the WordPress classic or Gutenberg page editor.

Once on the Restriction rules section, you need to select the following values to restrict access to the landing page by a specific date:

restrict access to landing pages by date range

  • Enable content restrictions: Yes
  • What happens when the conditions are met: Allow access
  • Condition 1: Date (YYYY-MM-DD) >= 2020-12-01
  • Click on the + button on Condition 1 to add a new “and” condition.
  • Condition 2: Date (YYYY-MM-DD) <= 2020-12-31
  • Update the page to save the changes.

Important:

  1. The date with the “>=” symbol is the initial date
  2. The date with the “<=” symbol is the final date
  3. You decide on which dates you want to use on your date range to restrict access to your landing pages.
  4. You need to repeat the same steps with the other pages you want to restrict by a specific date.

4- What happens when your landing pages are restricted and users try to access them?

With the WordPress Conditional Post Restrictions, you can decide what happens when your landing pages are restricted and users try to access them.

You need to configure that on the global settings of the plugin. Go to Settings > Post Restrictions in wp-admin. You can redirect users to your home page, for example, or show them an error message.

Restricting access to landing pages is really simple!

As you see, you don’t have to use any snippet to restrict access to your landing pages. Instead, you can use the WordPress Conditional Post Restrictions plugin to apply this and any other conditional restrictions to your posts, pages, and any other custom post type generated by other plugins (events, courses, donations, downloads, products, etc.).

You can download the plugin here:

Download WordPress Conditional Post Restrictions Plugin - or - Read more