admin-plugins author calendar category facebook post rss search twitter star star-half star-empty

Tidy Repo

The best & most reliable WordPress plugins

Free Show/Hide Content at Set Time

Please read! This plugin has not been updated in over 6 months. It may no longer be maintained or supported. There may be compatibility issues when used with the latest version of WordPress. We suggest finding a similar, alternative plugin. Learn more about outdated plugins.

Show/Hide Content at Set Time

Plugin Author: Dave Clements

Jay Hoffmann

November 3, 2014 (modified on May 25, 2018)

Admin, Editing

There will be times that you only want content to be on your site for a certain period of time, perhaps to be replaced by new content when that time is up. Maybe you’re running a contest, or you are only open during certain hours. Really the only solution is to manually update this content at these times. But Show/Hide Content allows you to use a simple shortcode which will hide and display content within a set time range.

What’s it Do?

Show/Hide Content at Set Time gives you access to a new shortcode, [time-restrict] which allows you to specify what time range content should be shown. You can choose to show content between a range of dates, between January 1st and March 27th for instance, or on only one day. You can also use the shortcode to set up a recurring schedule for content if you want to display content between 8 am and 5 pm every day for instance.

TheĀ time-restrict shortcode accepts any time format that is accepted by PHP, and you can specify a time range right down to the minute.

How’s it Work?

After you install and activate the plugin, you can begin using the time restrict shortcode on any post or page. You can do so by setting an on and off parameter and then placing your content between the shortcode beginning and end. Let’s say I want to show a single sentence between December 1st, 2014 and January 25th, 2015. I would set up my shortcode like this:

[time-restrict on="2015-01-01" off="2015-01-11"]A sample bit of text I want to show and then hide[/time-restrict]

You can also choose to begin showing content immediately by simply specifying an off parameter, or hide content until a specific day by just using an on the parameter. In both cases, content will only be shown or hidden starting or ending at the day that you enter.

[time-restrict off="2015-01-01"]This is a limited time offer[/time-restrict]
[time-restrict on="2015-01-01"]The offer is over[/time-restrict]

Show/Hide Content accepts any date format that PHP supports, so you can choose the one which is most comfortable for you. You can also specify a time of day. If you leave the time off, then the content will be displayed at midnight on the day you selected.

[time-restrict off="October 10th, 2014 14:00:00"]This content goes live on October 10th at 2pm[/time-restrict]

Recently, the plugin also added support for recurring, scheduled content. This is useful if you want to show content at certain times again and again. The shortcode here is a little different, you use [time-restrict-repeat] to activate it. You can choose to set content on a daily, weekly or monthly schedule, and then choose a time for content to start and begin.

[time-restrict-repeat type="daily" ontime="09:00:00" offtime="17:00:00"]Shows this content 9am to 5pm, every day[/time-restrict-repeat]
[time-restrict-repeat type="monthly" ondate="14" offdate="25"]Shows this content between the 14th and 25th of every month[/time-restrict-repeat]

There are, of course, lots of combinations that can be created using this feature. And if you’d like you can nest one shortcode inside of another, for instance, to show a piece of content Monday through Friday (using the weekly type) and between 9 am and 5 pm (using the daily type).

Costs, Caveats, Etc.

Show/Hide Content at Set Time recently underwent a pretty big update that added a lot of the features listed above. It is again in fairly active development and compatible with the latest version of WordPress. If you’re looking for more examples of what can be done, you can visit the Plugin page or go to the support forums for help from the developer.

Resources

Plugin Info
  • Downloads: 38,690+
  • Downloads trend (30d): +42.0%
  • Active installations: 10,000+
  • Rating:
  • Last Update: October 1st, 2019
  • Download Plugin for Free