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?
- Making update notification functionality for my themes
- How to get Images included in Post
- Best practice for including plugins as part of a theme?
- How to disable 3.1 “Admin Bar” via script for the admin user?
- Where do I find the functions triggered within a hook?
- Is it possible to display the admin bar while in the Theme Customizer?
- Is using eval() ok in this scenario
- Should I update my _s theme?
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- Display site admin profile fields in header.php
- WordPress Genesis Child Theme Filter divs
- Displaying part of every child page?
- How do I obtain the post content via a custom meta box inside the editor?
- Displaying Remote Data inside of Theme admin
- WordPress 5.8 update problem custom theme styles are overridden by core styles common.min.css
- How to correctly add JQuery in a WP theme?
- how to change a theme slug
- Weekly background code not working
- I want to get the home root path
- How to add code in the content area in a WordPress theme?
- Can I show all the template files that are being used on my site?
- How can i add edit shortcut icon in wordpress customizer without using selective refresh?
- Unable to pass variable on theme cusomizer add_settings()
- How to add Bootstrap Tour JavaScript to WordPress Admin Panel Dashboard Widget
- get_theme_mod returning no output
- Can I have a widget and sidebars in custom theme?
- Select full Image Size on widget “Genesis – Featured Posts”
- Where to find the code that redirects requests on the static page URL to the home page
- How to change database values on theme update
- after renaming my wp-content folder, how do I upgrade my wordpress version?
- Issue on Adding A Class to Bootstrap Navbar Walker Dropdown
- Make custom CSS changes and use built in theme customizer later?
- Is it possible to save more than one image to an option?
- Theme’s window.open call goes to “Page Not Found”
- Inserting images in multiple posts native gallery
- Should i clear the plugin cache for cache busting?
- Renaming a theme so it aids SEO and the theme used is hidden
- Dynamic menu links after header title
- Does the textdomain have to be the theme’s name?
- Prerequisites Skills to learn WordPress [closed]
- How to rotate every letter in a title
- Should I create multiple sidebars, or use or one dynamic sidebar with logic to determine it’s abilities?
- WordPress Theme that returns all posts as a JSON object?
- Can I make a Customizer dropdown-pages list include private pages?
- HTML block gutenberg templates
- Use a filter on menu items that have children
- Custom permalink for each post
- Password protect a custom template
- Reusable and site-wide content that can be used in a theme
- New to WordPress – Read the Codex, Other Docs; Still Confused
- Style first 3 posts differently with WP_Query [duplicate]
- Update value of a associative array with update_post_meta
- is_front_page use in sidebar.php
- matisse theme show excerpts not whole content
- My custom taxonomies are not showing up in the admin menus
- get main URL from subdirectory with php
- Featured Images most often doesnt appear
- How to add custom theme in hosting server?
- Is there a plugin for versioning files in the theme (style , .js and .php files)?
- SELECT custom post type and its meta in SQL
- Infinite loop when nesting have_posts()
- WordPress Custom Theme : Theme Builder vs ACF vs Gutenberg
- Is_single not working properly in genesis
- How to wrap image tag into div for post only?
- Debugging slow WordPress Theme Customizer (Any option similar to Query Monitor)?
- update a posts of other custom post type
- How to show children pages as array
- wp_nav_menu custom walker class
- Show posts between two Custom Fields date
- Changes to template not showing up unless ?reset=1 added to URL
- How do I keep images in posts below a certain size without editing the post?
- Theme options not displaying correctly after theme update
- Is it possible to customize the layout of Gallery Shortcode?
- How can i use archive.php for indexing wordpress default posts?
- What to do when child theme is out of date with parent theme
- Image Size wrong during upload
- How can I add a single image from a gallery into the page header?
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?
- Theme template file for a specific custom taxonomy
- How do I work with responsive images in WordPress? (img srcset/sizes)
- How can I use pre declared blocks in a php file?
- jQuery Snippet Not Working on WordPress Site [closed]