You can create a new page/post for this and set a custom publish date for it, but
now the question is:
How can you make a page to be available for a specified amount of time and replace it with something else after this?
One usage example would be if you want to do a limited time offer and after this you want to replace or hide the page.
As you can imagine I’m looking for a solution that would allow you schedule this, so you could be in vacation when the change happens 😉
If you made your special offers a custom post type you could set the ‘scheduled’ date to the day you wanted it to expire then use this code to auto publish it on schedule after you’ve changed the scheduled date. The ‘future_show’ line goes with my ‘show’ custom post type so if you had a ‘deal’ custom post type it would say ‘future_deal’.
You can then set the post to expire if it’s older than today on the server with the code below. It hooks into WordPress cron so you’re not running it all the time but you’ll notice a line commented out that runs it on init so you can test it. For testing comment out the first 3 lines and use the init action. Don’t do this on production though.
Don’t forget to change my function prefix (sfn) to your own just to sandbox it’s function from anything else.
Edit I just also thought that you could change the SQL query to grab posts in a category of ‘deal’ and it would work the same way. Creating an entire post type then including it in the site/blog may be more work than is needed.