1

I want to create a form in which when a front-end sets a date and on that date the post gets automatically deleted. Is it possible?

  • Assuming that you mean, delete a post on a specific date, look here. No idea why you want to specify that in a form. If my link leads to the answer this post should be tagged as duplicate imho. – Charles Jun 29 '15 at 17:40
0

I will say, I don't exactly understand your words "when a front-end sets a date"...

I'm assuming wp-admin setup. Go find a post expiration plugin. There seem to be more than a couple of these out there. The plugin I've used ws "Post Expirator" Awesome tool. You can create a start posting and stop posting date when the post is created. I used it on a site that was advertising future events. You could create a whole years worth of upcoming events, and then schedule the posts to start displaying one month before the event, and they'd expire the day after the event. Way cool.

Obviously for a form, this will only work if the form is contained within the post, perhaps short code style?

If you want the site's users to be able to set something up an expiration date that is an entirely different conversation. I think that is do-able as a new custom plugin. Not easy, but do-able.

  • I want the site users to set an expiration date through a form... – Megh Gandhi Jun 30 '15 at 11:27
  • Awesome. You may want to brush up on your php skills. Use Post Expirator plug-in as a concept guide, then create your own custom plugin (or better yet, supplement the Post Expirator plugin with your own functions.php file. ) From looking at post-expirator.php, it looks like the author is using the meta tag system to manage expiration dates. Not sure how your users are submitting data to the server, but I'd assume it with a form submit? (If not, you can use an Ajax submit.) Grab the desired date from your users, and put that right into the Post Expirator system. Should be a fun project. – zipzit Jun 30 '15 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.