The post by itself is only data, it cannot perform such action as expiring itself. So you need some form of external control to act on it.
You can use WP Cron (see wp_schedule_event()
and related) to run periodic task that will query for posts by your custom field and perform wanted action on them (trashing, cancelling published status, etc).
Related Posts:
- How to sanitize select box values in post meta?
- Strategy to get post meta for use outside the loop
- How can I include a post in a theme?
- Relative Time On Posts
- Adding “latest from the blog” to the homepage
- Is there a need for nonce with Post Metabox?
- Metadata Query when storing data as array possible?
- Wp Super Cache stops the update of a Post Meta
- How to show specific post meta?
- Running a function on post update with new post meta
- Is it possible to set a variable for get_post_meta?
- Get attachment meta (I need attachment ID, unsure how to find it)
- How can I sort my loop based on meta data, using a form?
- Related Post Category Filter
- Make a custom field in admin post.php read only
- Change default options on attachment page
- After a while attachment meta data is missing “sizes” data
- Why is my Toggle field not showing in Gutenberg?
- How do I access the current post object within a block theme template or pattern?
- How to escape html generate by a loop
- Template for landing pages
- How to Create custom xml file for demo content for custom theme?
- post_exists returning 0 if title contain special characters
- Wpautop in wp_editor not working
- Comment status shows ‘closed’ in db, but it shows ‘open’ when i echo it
- How to unset a set query variable?
- How to list articles by year based on url?
- Archieve.php not loading for custom post type
- I used single quote to design HTML of my WordPress blog. Now site redirects to index.php everytime than page.php or single.php
- Change Responsive Images Maximum Width of 1600px
- Is there any way to register custom background images like header images?
- ACF Pro make URL Linked in Custom Template [closed]
- How to change the theme directory uri for localhost?
- Customize rel=canonical tag for single blog post
- Why is my CSS not loading?
- How to find default functions of wordpress
- Change all author links in Blog roll
- How to remove ver from stylesheet URL? [duplicate]
- How to I retrieve the ID from the Posts page?
- What is the diferences between pure WordPress theme and Woocommerce theme? [closed]
- How to save meta checkbox WordPress
- How to escape multiple attribute at once in WordPress?
- Override plugin option by with a custom theme
- Using a starter theme vs starter theme with child theme
- How should I use starter content utility to show some default menus?
- Set a featured image as a replacement to the header image
- How to remove ID’s from wp_enqueue_style?
- Replace site title with logo when logo is uploaded in customizer using
- Unique design inside a specific category’s url
- How to rotate every letter in a title
- Is it possible to have a theme that uses only one single page?
- What does WordPress do if I save a post without content/title? [duplicate]
- wordpress 404 not found after rewrtie the author link
- Custom theme: How to call archive-post.php for viewing blog posts
- Exclude custom post type from search conflict with get_posts
- Dynamic Post Thumbnail →
- Will my site get messed up when the wordpress theme updates if I edited the html code in the editor to change footer?
- Have the homepage look different to index.php without a static page
- underscores use of the article element on the page template
- Cherry framework – Overriding function in template-general.php
- Ideal inline dynamic CSS injection
- What Does “Cannot modify header information?” Mean
- How to transfer one domain to another domain without losing theme options (customizer)?
- How to create and populate with few links a menu in child theme functions.php?
- Plugin does not work in custom theme
- How to seperate static phrases from template files in custom theme?
- Javascipt issue on custom theme
- Change frontpage content via WordPress
- How to Manually Code Shortcode?
- How to Have a Pure HTML Sub Directory In WP Site
- is_home and is_frontpage always true
- How to correctly enqueue the parent and child theme stylesheets in the creation of a child theme? [duplicate]
- How to show a manageable list of images on a post?
- header_image not returning header image url
- Create a child theme from multiple themes
- Taxonomy-$taxonomy-$term not working
- How to add a class to edit_post_link?
- Theme not showing up
- How to calculate the average of a post meta value(Numeric) of a specific author
- html5-reset theme does not show the image [closed]
- Managing WordPress Theme
- WordPress HTML5 Gallery Support – Convert HTML4 -> HTML5
- Theming Using Bootstrap Glyphicons and WordPress Dashicons
- get_term_link is Ending to single.php
- Issue On Displaying Pages with Post Name Permalink
- Issue on Getting Custom post type Thumbnail’s URL
- How To Pick Custom Size Of Uploaded Image In Theme Via the_post_thumbnail();?
- How to show an entire post content and not also the excerpt?
- Is there any way to tell when wp_postmeta has been updated?
- Take control of WordPress before functions.php
- Overide enqueue in non plugable function via child theme
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Why in the static pages of my theme are showing these information?
- Forms won’t submit
- Can’t use admin_enqueue_scripts or wp_enqueue_script
- How to make javascript work on theme options page
- featured content: which area does this cover [closed]
- How to count posts of a category and of a category limited by a tag
- How is the `get_sidebar` function meant to be used to call a 2nd sidebar?
- How to register and enqueue JavaScript files without breaking plugin dependencies?