Content MarketingData and Development

WordPress Date Gate Shortcode: Reveal or Expire Content by Date and Time

A registration form that should turn into a recording link when the webinar starts. A Black Friday code that should appear on Friday morning and vanish Monday night. A product announcement that shouldn’t be visible until launch day. Each of these is easy to write and awkward to manage, because someone has to remember to edit the page at the right moment, often at midnight or on a holiday.

The Date Gate Shortcode plugin for WordPress handles those changes for you. You write the content that should appear during a window, optionally add a replacement for everyone who visits outside it, and the page shows the right version on its own. Version 2.1 uses a single [date_gate] shortcode with start and end attributes and an optional [else] separator, and it follows current WordPress coding practices throughout.

Key Takeaways

  1. The Date Gate plugin adds one shortcode, [date_gate], that shows its enclosed content only inside a start and end window. You can set a start, an end, or both.
  2. An optional [else] separator marks replacement content for anyone who visits outside that window. Without it, the content simply reveals at the start and expires after the end, and the shortcode prints nothing.
  3. Both sides of [else] can include HTML, links, and other shortcodes. All dates use the timezone in your WordPress settings, and an invalid or missing date hides the content rather than showing it by mistake.
  4. When you save a post, the plugin schedules a cache purge just after every future boundary, so cached pages don’t keep showing an expired offer.

What the Date Gate Shortcode Does

The plugin registers one shortcode with this syntax:

[date_gate start="" end=""]window content (HTML, links, and shortcodes allowed)[else]content shown outside the window[/date_gate]

Set a start date, an end date, or both. At least one is required. Visitors who arrive inside that window see the content before [else]. Visitors who arrive before the start or after the end see the content after [else]. If you leave [else] out, the shortcode prints nothing outside the window, so the content reveals at the start and expires after the end.

Both sides of [else] can include HTML, links, and other shortcodes. Everything runs on the server in PHP, so there’s no JavaScript countdown, no flash of hidden content, and nothing left in the page source for visitors to find early. The switch happens on the first page load after the boundary.

How to Install the Plugin

Copy the full plugin code at the end of this article into a file named date-gate-shortcode.php, place it in a new wp-content/plugins/date-gate-shortcode/ folder, and activate Date Gate Shortcode from the Plugins screen. There’s no settings page. The plugin needs WordPress 6.0 or later and PHP 7.4 or later, and it runs on PHP 8.x.

In the block editor, add the shortcode to a Shortcode block when the gated content spans several lines or includes HTML, or type it inline inside a paragraph for a single sentence. Keep each shortcode within one block, because a shortcode can’t span several blocks.

Show Content Between a Start and End Date

Use a start and an end when something should only appear for a limited time, like a promotional code. This offer appears at midnight on November 27 and disappears after 11:59 p.m. on November 30:

[date_gate start="2026-11-27 00:00" end="2026-11-30 23:59"]
  Save 50% on every plan this Black Friday. Enter code BF50 at checkout.
[/date_gate]

A date without a time works too. A date-only start begins at 12:00 a.m. that day, and a date-only end runs through 11:59:59 p.m., so end="2026-11-30" includes all of November 30.

Leave a Message When the Window Closes

Add an [else] separator when you want a replacement to appear outside the window. This Black Friday offer shows the discount during the sale, then an ended message with a newsletter link afterward, and that same message also shows before the sale starts:

[date_gate start="2026-11-27 00:00" end="2026-11-30 23:59"]
  Save 50% on every plan this Black Friday. Enter code BF50 at checkout.
[else]
  This Black Friday offer has ended. <a href="/newsletter/">Join the newsletter</a> to hear about the next one.
[/date_gate]

The content after [else] is a full shortcode body, so it can hold links, markup, and other shortcodes, just like the content before it.

Replace Content at a Deadline

If you only need one switch, set an end date and put the later version after [else]. Until that moment visitors see the first version; afterward they see the second. This is useful for an event registration page that should become a recording page once the event begins:

[date_gate end="2026-12-10 10:00"]
  <h2>Join Us Live on December 10</h2>
  <p>Our marketing technology roundtable starts at 10 a.m. Reserve your seat below.</p>
  [button link="/register/"]Register Now[/button]
[else]
  <h2>Thanks for Joining Us</h2>
  <p>The live session has ended. Watch the full recording below.</p>
  [button link="/recording/"]Watch the Recording[/button]
[/date_gate]

Before 10:00 a.m. on December 10, visitors see the registration heading and button. From 10:00 a.m. on, they see the recording. Because there is no start date, the registration content is visible from the moment you publish the page until that deadline.

Expire Content With No Replacement

To make content disappear after a deadline and leave nothing in its place, set an end date and omit [else]. This early-bird notice prints through the end of December 31 and nothing afterward:

[date_gate end="2026-12-31"]Early-bird pricing ends December 31. Lock in your rate today.[/date_gate]

When an expired shortcode sits inside a paragraph, the plugin also removes the empty paragraph it leaves behind, so the page doesn’t show a blank gap.

Schedule a Future Reveal

To publish part of a live page later, set only a start date and omit [else]. Nothing appears until that moment, and the content stays visible from then on:

[date_gate start="2027-01-15 09:00"]
  <h2>Announcing Version 3</h2>
  <p>Version 3 is live. Here's everything that's new.</p>
[/date_gate]

This is useful for launch announcements, embargoed press details, a contest winner, or a download link that should go live with an event, all without scheduling a separate post.

Date Formats and Time Zones

The plugin reads every date in the timezone set under Settings, then General, using wp_timezone() and PHP’s DateTimeImmutable. It accepts these formats:

  • 2026-11-27 for a date only
  • 2026-11-27 09:00 or 2026-11-27 09:00:00 for a date and time
  • 2026-11-27T09:00:00-05:00 for an ISO 8601 date with a timezone offset, which pins an exact moment no matter what the site setting is

The plugin checks each date strictly. If a date is missing, can’t be read, doesn’t exist (such as February 30), the end comes before the start, or you set neither a start nor an end, the shortcode fails closed and shows nothing, which is safer than accidentally showing an expired code. Editors on a site with WP_DEBUG turned on see an HTML comment explaining the problem.

How the Plugin Handles Caching

Page caching is the biggest risk with time-based content. A caching plugin, host, or CDN saves a copy of the page and serves it until something clears it, so without a purge, visitors could keep seeing a Black Friday code days after it ended.

Each time you save a post, the plugin reads every [date_gate] shortcode in it, clears any purges it scheduled earlier for that post, and uses wp_schedule_single_event() to schedule a new purge 30 seconds after each future boundary. When that purge runs on a published post, it calls clean_post_cache() and then the public purge function of each supported caching plugin that’s installed:

Every call is guarded with function_exists() or has_action(), so a missing plugin never causes an error. For anything else, such as a Kinsta server cache, a Varnish layer, or a CDN API, hook into the date_gate_purge_post action shown below.

WP-Cron runs when your site receives traffic, so a purge can land a little after its scheduled time on a quiet site. For precise timing, disable the traffic trigger and run WP-Cron from a server cron job every few minutes. Purges only reschedule when a post is saved, so if you add a date gate with a direct database edit or an import, open and update the post once.

Hooks for Developers

The plugin includes filters and actions so you can extend it without editing the plugin file:

  • shortcode_atts_date_gate filters the shortcode attributes, the standard WordPress shortcode_atts() filter.
  • date_gate_now filters the current time, which is useful for previewing future states or testing.
  • date_gate_output filters the final HTML along with the current state: before, during, after, or invalid.
  • date_gate_purge_post fires at each boundary with the post ID, permalink, and boundary timestamp.

For example, this code lets editors preview any date with a query string and purges an extra CDN:

// Preview any date with ?date_gate_preview=2026-11-28T12:00 (editors only).
add_filter( 'date_gate_now', function ( $now ) {
    if ( current_user_can( 'edit_posts' ) && ! empty( $_GET['date_gate_preview'] ) ) {
        $preview = date_create_immutable( sanitize_text_field( wp_unslash( $_GET['date_gate_preview'] ) ), wp_timezone() );
        return $preview ? $preview : $now;
    }
    return $now;
} );

// Purge a CDN or host cache that the plugin doesn't know about.
add_action( 'date_gate_purge_post', function ( $post_id, $url, $boundary ) {
    my_cdn_purge_url( $url ); // Replace with your host or CDN's purge function.
}, 10, 3 );

The Full Plugin Code

The plugin prefixes every function, exits when loaded outside WordPress, loads its date-gate-shortcode text domain for translations, removes its scheduled events on deactivation, and deletes its stored post meta on uninstall. It splits the enclosed content on a literal [else] and runs do_shortcode() on the part that matches the current state, so other enclosing shortcodes inside either part work as expected. It also removes the stray <p> and <br> tags that automatic paragraph formatting can leave around shortcodes.

<?php
/**
 * Plugin Name:       Date Gate Shortcode
 * Plugin URI:        https://martech.zone/future-posts/
 * Description:       Show content only inside a start and end window, with optional replacement content outside that window and automatic cache purges at each boundary.
 * Version:           2.1.0
 * Requires at least: 6.0
 * Requires PHP:      7.4
 * Author:            Douglas Karr
 * Author URI:        https://dknewmedia.com
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       date-gate-shortcode
 *
 * Usage:
 *   [date_gate start="2026-11-27 00:00" end="2026-11-30 23:59"]
 *   Offer content, HTML, and shortcodes
 *   [else]
 *   This offer has ended. <a href="/newsletter/">Join the newsletter</a>.
 *   [/date_gate]
 *
 * start and end are each optional, but at least one is required.
 * Content before [else] shows inside the window. Content after [else] shows
 * outside it (before start or after end). Without [else], nothing is shown
 * outside the window, so the content reveals at start and expires after end.
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

define( 'DATE_GATE_VERSION', '2.1.0' );
define( 'DATE_GATE_CRON_HOOK', 'date_gate_boundary_purge' );
define( 'DATE_GATE_META_KEY', '_date_gate_boundaries' );

/**
 * Load translations and register shortcodes.
 */
function date_gate_init() {
	load_plugin_textdomain( 'date-gate-shortcode', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );

	add_shortcode( 'date_gate', 'date_gate_shortcode' );
	// Inert separator: the handler splits on the literal [else] before do_shortcode.
	// Registering it as an empty shortcode is a safety net if one is left behind.
	add_shortcode( 'else', '__return_empty_string' );
}
add_action( 'init', 'date_gate_init' );

/**
 * Parse a date attribute in the site timezone.
 *
 * Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, YYYY-MM-DD HH:MM:SS, or ISO 8601 with an offset.
 * A date-only end value runs through 23:59:59 that day.
 *
 * @param string $value  Raw attribute value.
 * @param bool   $is_end Whether this is an end boundary.
 * @return DateTimeImmutable|null|false Null when empty, false when invalid.
 */
function date_gate_parse_date( $value, $is_end = false ) {
	$value = trim( sanitize_text_field( (string) $value ) );
	if ( '' === $value ) {
		return null;
	}

	$tz      = wp_timezone();
	$formats = array(
		'!Y-m-d H:i:s'   => false,
		'!Y-m-d H:i'     => false,
		'!Y-m-d\TH:i:sP' => false,
		'!Y-m-d\TH:iP'   => false,
		'!Y-m-d\TH:i:s'  => false,
		'!Y-m-d\TH:i'    => false,
		'!Y-m-d'         => true,
	);

	foreach ( $formats as $format => $date_only ) {
		$date   = DateTimeImmutable::createFromFormat( $format, $value, $tz );
		$errors = DateTimeImmutable::getLastErrors();
		$clean  = ( false === $errors ) || ( 0 === $errors['warning_count'] && 0 === $errors['error_count'] );
		if ( $date && $clean ) {
			if ( $date_only && $is_end ) {
				$date = $date->setTime( 23, 59, 59 );
			}
			return $date;
		}
	}

	return false;
}

/**
 * Split enclosed content on the literal [else] separator.
 *
 * @param string $content Enclosed shortcode content.
 * @return array{0:string,1:?string} During content, and outside content or null when [else] is absent.
 */
function date_gate_split_else( $content ) {
	$content = (string) $content;
	if ( false === strpos( $content, '[else]' ) ) {
		return array( $content, null );
	}
	$parts = explode( '[else]', $content, 2 );
	return array( $parts[0], $parts[1] );
}

/**
 * Tidy wpautop debris (stray </p> at the start, <p> at the end, empty paragraphs, and leading <br />).
 *
 * @param string $html Fragment.
 * @return string
 */
function date_gate_clean_fragment( $html ) {
	$html = (string) $html;
	$html = preg_replace( '#^\s*(?:</p>|<br\s*/?>)\s*#i', '', $html );
	$html = preg_replace( '#\s*(?:<p(?:\s[^>]*)?>|<br\s*/?>)\s*$#i', '', $html );
	$html = preg_replace( '#<p(?:\s[^>]*)?>\s*</p>#i', '', $html );
	return trim( $html );
}

/**
 * Work out which state applies right now.
 *
 * @param array             $atts Normalized attributes.
 * @param DateTimeImmutable $now  Current time.
 * @return string before|during|after|invalid
 */
function date_gate_state( $atts, DateTimeImmutable $now ) {
	$start = date_gate_parse_date( $atts['start'] );
	$end   = date_gate_parse_date( $atts['end'], true );
	if ( false === $start || false === $end || ( null === $start && null === $end ) ) {
		return 'invalid';
	}
	if ( $start && $end && $end < $start ) {
		return 'invalid';
	}
	if ( $start && $now < $start ) {
		return 'before';
	}
	if ( $end && $now > $end ) {
		return 'after';
	}
	return 'during';
}

/**
 * [date_gate] handler.
 *
 * @param array|string $atts    Attributes.
 * @param string|null  $content Enclosed content.
 * @param string       $tag     Shortcode tag.
 * @return string
 */
function date_gate_shortcode( $atts, $content = null, $tag = 'date_gate' ) {
	$atts = shortcode_atts(
		array(
			'start' => '',
			'end'   => '',
		),
		$atts,
		$tag
	);

	$content = (string) $content;
	$now     = new DateTimeImmutable( 'now', wp_timezone() );
	/** Filter the current time, which is useful for previews and tests. */
	$filtered = apply_filters( 'date_gate_now', $now, $atts );
	if ( $filtered instanceof DateTimeInterface ) {
		$now = DateTimeImmutable::createFromFormat( 'U', (string) $filtered->getTimestamp() )->setTimezone( wp_timezone() );
	}
	$state = date_gate_state( $atts, $now );

	list( $during, $outside ) = date_gate_split_else( $content );

	switch ( $state ) {
		case 'during':
			$raw = $during;
			break;
		case 'before':
		case 'after':
			// No [else] means nothing is shown outside the window.
			$raw = ( null === $outside ) ? '' : $outside;
			break;
		default:
			// Invalid dates fail closed: nothing is shown to visitors.
			$raw = '';
			if ( current_user_can( 'edit_posts' ) && defined( 'WP_DEBUG' ) && WP_DEBUG ) {
				/* translators: Debug note for editors when date_gate attributes are invalid. */
				$raw = '<!-- ' . esc_html__( 'date_gate: invalid or missing date attributes.', 'date-gate-shortcode' ) . ' -->';
				return apply_filters( 'date_gate_output', $raw, $state, $atts, $content );
			}
	}

	$output = date_gate_clean_fragment( do_shortcode( shortcode_unautop( $raw ) ) );
	if ( '' === $output ) {
		date_gate_flag_empty( true );
	}

	/**
	 * Filter the final output.
	 *
	 * @param string $output  HTML to print.
	 * @param string $state   before|during|after|invalid.
	 * @param array  $atts    Attributes.
	 * @param string $content Raw enclosed content.
	 */
	return apply_filters( 'date_gate_output', $output, $state, $atts, $content );
}

/**
 * Remember whether a gate printed nothing during the current content render.
 *
 * @param bool|null $set True to raise the flag, false to reset, null to read.
 * @return bool
 */
function date_gate_flag_empty( $set = null ) {
	static $flag = false;
	if ( null !== $set ) {
		$flag = (bool) $set;
	}
	return $flag;
}

/**
 * Remove paragraphs left empty when a gate printed nothing, so no blank gap remains.
 * Runs after do_shortcode (priority 11) and only when a gate was empty.
 *
 * @param string $content Post content.
 * @return string
 */
function date_gate_remove_empty_paragraphs( $content ) {
	if ( ! date_gate_flag_empty() ) {
		return $content;
	}
	date_gate_flag_empty( false );
	$content = preg_replace( '#<p(?:\s[^>]*)?>(?:\s|&nbsp;|<br\s*/?>)*</p>\s*#i', '', $content );
	// Some themes and filters drop the closing tag after a shortcode; remove an empty, unclosed <p> before the next block.
	return preg_replace( '#<p(?:\s[^>]*)?>\s*(?=<(?:p|h[1-6]|div|ul|ol|figure|blockquote|table|pre|section)[\s>]|$)#i', '', $content );
}
add_filter( 'the_content', 'date_gate_remove_empty_paragraphs', 12 );

/**
 * Collect every future boundary timestamp in a post's [date_gate] shortcodes.
 *
 * @param string $content Raw post content.
 * @return int[] Unix timestamps.
 */
function date_gate_find_boundaries( $content ) {
	$times = array();
	if ( false === strpos( (string) $content, '[date_gate' ) ) {
		return $times;
	}
	preg_match_all( '/' . get_shortcode_regex( array( 'date_gate' ) ) . '/s', $content, $matches, PREG_SET_ORDER );
	foreach ( $matches as $m ) {
		if ( '[' === $m[1] ) {
			continue;
		}
		$atts = shortcode_parse_atts( $m[3] );
		$atts = is_array( $atts ) ? $atts : array();
		foreach ( array( 'start' => false, 'end' => true ) as $key => $is_end ) {
			if ( empty( $atts[ $key ] ) ) {
				continue;
			}
			$date = date_gate_parse_date( $atts[ $key ], $is_end );
			if ( $date ) {
				// End boundaries flip one second after the inclusive end.
				$times[] = $date->getTimestamp() + ( $is_end ? 1 : 0 );
			}
		}
	}
	$times = array_values( array_unique( array_map( 'intval', $times ) ) );
	sort( $times );
	return $times;
}

/**
 * Clear previously scheduled purges for a post.
 *
 * @param int $post_id Post ID.
 */
function date_gate_unschedule_post( $post_id ) {
	$stored = get_post_meta( $post_id, DATE_GATE_META_KEY, true );
	foreach ( (array) $stored as $ts ) {
		wp_unschedule_event( (int) $ts + 30, DATE_GATE_CRON_HOOK, array( (int) $post_id, (int) $ts ) );
	}
	delete_post_meta( $post_id, DATE_GATE_META_KEY );
}

/**
 * Schedule a purge 30 seconds after every future boundary in a post.
 *
 * @param int $post_id Post ID.
 * @return int[] Scheduled boundary timestamps.
 */
function date_gate_schedule_post( $post_id ) {
	$post_id = (int) $post_id;
	date_gate_unschedule_post( $post_id );

	$post = get_post( $post_id );
	if ( ! $post || wp_is_post_revision( $post ) || wp_is_post_autosave( $post ) ) {
		return array();
	}

	$future = array();
	foreach ( date_gate_find_boundaries( $post->post_content ) as $ts ) {
		if ( $ts <= time() ) {
			continue;
		}
		$args = array( $post_id, $ts );
		if ( ! wp_next_scheduled( DATE_GATE_CRON_HOOK, $args ) ) {
			wp_schedule_single_event( $ts + 30, DATE_GATE_CRON_HOOK, $args );
		}
		$future[] = $ts;
	}
	if ( $future ) {
		update_post_meta( $post_id, DATE_GATE_META_KEY, $future );
	}
	return $future;
}

/**
 * Reschedule on save.
 *
 * @param int     $post_id Post ID.
 * @param WP_Post $post    Post object.
 */
function date_gate_on_save( $post_id, $post ) {
	if ( wp_is_post_revision( $post_id ) || wp_is_post_autosave( $post_id ) ) {
		return;
	}
	if ( 'trash' === $post->post_status ) {
		date_gate_unschedule_post( $post_id );
		return;
	}
	date_gate_schedule_post( $post_id );
}
add_action( 'save_post', 'date_gate_on_save', 20, 2 );
add_action( 'before_delete_post', 'date_gate_unschedule_post' );

/**
 * Cron callback: purge caches for the post at a boundary.
 *
 * @param int $post_id  Post ID.
 * @param int $boundary Boundary timestamp.
 */
function date_gate_purge_post( $post_id, $boundary = 0 ) {
	$post_id = (int) $post_id;
	if ( 'publish' !== get_post_status( $post_id ) ) {
		return;
	}
	$url = get_permalink( $post_id );

	clean_post_cache( $post_id );

	if ( function_exists( 'rocket_clean_post' ) ) {
		rocket_clean_post( $post_id ); // WP Rocket.
	}
	if ( function_exists( 'w3tc_flush_post' ) ) {
		w3tc_flush_post( $post_id ); // W3 Total Cache.
	}
	if ( function_exists( 'wp_cache_post_change' ) ) {
		wp_cache_post_change( $post_id ); // WP Super Cache.
	}
	if ( has_action( 'litespeed_purge_post' ) ) {
		do_action( 'litespeed_purge_post', $post_id ); // LiteSpeed Cache.
	}
	if ( function_exists( 'sg_cachepress_purge_cache' ) ) {
		sg_cachepress_purge_cache( $url ); // SiteGround Speed Optimizer.
	}
	if ( has_action( 'rt_nginx_helper_purge_url' ) ) {
		do_action( 'rt_nginx_helper_purge_url', $url ); // Nginx Helper.
	}
	if ( has_action( 'cache_enabler_clear_page_cache_by_post' ) ) {
		do_action( 'cache_enabler_clear_page_cache_by_post', $post_id ); // Cache Enabler.
	}
	if ( has_action( 'breeze_clear_all_cache' ) ) {
		do_action( 'breeze_clear_all_cache' ); // Breeze (Cloudways).
	}
	if ( class_exists( 'autoptimizeCache' ) && method_exists( 'autoptimizeCache', 'clearall' ) ) {
		autoptimizeCache::clearall(); // Autoptimize.
	}
	if ( has_action( 'cloudflare_purge_by_url' ) ) {
		do_action( 'cloudflare_purge_by_url', array( $url ) ); // Cloudflare plugin.
	}

	/**
	 * Hook for hosts or custom caches (Kinsta, Varnish, CDNs, and others).
	 *
	 * @param int    $post_id  Post ID.
	 * @param string $url      Permalink.
	 * @param int    $boundary Boundary timestamp.
	 */
	do_action( 'date_gate_purge_post', $post_id, $url, (int) $boundary );
}
add_action( DATE_GATE_CRON_HOOK, 'date_gate_purge_post', 10, 2 );

/**
 * Remove every scheduled purge for this plugin.
 */
function date_gate_clear_all_events() {
	if ( function_exists( 'wp_unschedule_hook' ) ) {
		wp_unschedule_hook( DATE_GATE_CRON_HOOK );
	}
}
register_deactivation_hook( __FILE__, 'date_gate_clear_all_events' );

/**
 * Activation: register the uninstall routine (WordPress recommends doing this on activation).
 */
function date_gate_activate() {
	register_uninstall_hook( __FILE__, 'date_gate_uninstall' );
}
register_activation_hook( __FILE__, 'date_gate_activate' );

/**
 * Uninstall: remove events and stored boundary meta.
 */
function date_gate_uninstall() {
	date_gate_clear_all_events();
	delete_post_meta_by_key( DATE_GATE_META_KEY );
}

Frequently Asked Questions

Does the Date Gate Shortcode Use JavaScript?

No. The plugin decides what to show on the server with PHP each time the page is built, so visitors only ever receive the content for the current state, and nothing hidden is left in the page source.

Which Timezone Does the Shortcode Use?

It uses the timezone set under Settings, then General, in WordPress through wp_timezone(). You can also pass an ISO 8601 date with an offset, such as 2026-11-27T09:00:00-05:00, to pin an exact moment.

What Happens If I Enter an Invalid Date?

The shortcode fails closed and prints nothing to visitors. An end date earlier than the start date, an impossible date like February 30, or text such as next Tuesday are all treated as invalid. A shortcode with no start and no end is also invalid.

How Do I Make Content Disappear After a Date?

Set an end date and leave out the else separator. The enclosed content prints until that deadline, then the shortcode prints nothing. A date-only end, such as end=”2026-12-31″, includes all of that day.

How Do I Show a Message After an Offer Ends?

Add an else separator and put the ended message after it. That replacement can include HTML, links, and other shortcodes, and it also shows before the start date if you set one.

Will My Caching Plugin Keep Showing Old Content?

When you save the post, the plugin schedules a purge 30 seconds after every future boundary and clears the post cache in WordPress and in WP Rocket, W3 Total Cache, WP Super Cache, LiteSpeed Cache, SiteGround Speed Optimizer, Nginx Helper, Cache Enabler, Breeze, Autoptimize, and the Cloudflare plugin. WP-Cron runs when your site gets traffic or from a server cron job, so a busy cache may show old content for a few minutes after the boundary.

Can I Nest One Date Gate Inside Another?

No. WordPress cannot parse a shortcode nested inside another shortcode with the same name. Use separate date_gate shortcodes one after another instead.

Related Articles