from How can I change HTTP headers only to posts of a specific category from a plugin:
add_action( 'template_redirect', 'update_header_cache' );
function update_header_cache() {
if( is_single( 1234) ) {
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Expires: Thu, 01 Dec 1990 16:00:00 GMT');
}
}
Related Posts:
- wp_headers vs send_headers. When to use each?
- How do I use the ‘http_request_host_is_external’ filter
- How to remove X-Frame-Options: SAMEORIGIN” from WordPress?
- No ‘Access-Control-Allow-Origin’ header is present [closed]
- How to properly modify WP Vary or any existing headers?
- How would I use a filter to remove header banner on certain post types
- How to show page content in feed?
- Sanitize and data validation with apply_filters() function
- How many filter/action hooks are healthy?
- remove_filter( ‘the_content’, ‘wpautop’ ); only for certain post types
- Valid characters for actions, hooks and filters
- How to hook into unregistering a widget instance?
- get_option() filtering and getting out of recursion
- Get excerpt from $post->post_content
- AJAX filter posts on click based on category
- How can I filter Microsoft Word gunk from pasted content?
- Can I add custom meta for each image uploaded via media-upload.php?
- How do I know if author field was changed on post save?
- Load different template file when condition met?
- WordPress 3.5+ upload tool filter
- Some questions regarding filter
- Use content custom filter for all shortcodes
- Filter all html output
- Problem getting single_template filter to work – I want to serve a different single.php file for posts in a certain category
- Too many actions/filters!
- Which hook is fired when inserting media into a post
- How can override a add_filter of a plugin?
- Adding Filter Conditionally Per Page ID
- How to specify which category of the post to use in case of multiple categories
- Return array of images after content
- Nested calls the the_content filter
- How to change domain used when pinging sites
- return values from hooks do_action and apply_filters, which is better
- Return a custom value in a function added to an action hook
- Using Conditional Statement in functions.php
- get_title without filter(the_title)
- How can filters be run when they are never applied?
- Multiple filters for wp_get_archive
- get_bookmarks filter not supplying query argument (wp 3.1)
- Filter and modify entry-footer link in twentyseventeen
- Function the_content not working
- Is there a filter called ‘network_admin_init’?
- Break out of wordpress filter
- Manipulating show_on_front, page_on_front, page_for_posts and template hierarchy
- Post Content, Special Characters and Filters
- Correct method of redirecting user login
- Add filter problems
- Where is the content cache when using apply_filters(‘the_content…?
- How to prepare WordPress Rest data for Preview Changes?
- How to validate recaptcha on comments form?
- Does a plugin with a AJAX button filter exist? [closed]
- Is there any filter to trigger as soon as media is uploaded to post or page?
- Filtering the post list in the admin area
- add_filter with retrieve_password_message() not working in plugin, but works in functions.php
- How to check if a protected hook is hooked?
- Add a div of content within the_content after a certain block
- Gutenberg Block – Post Featured Image Filter Hook
- separate categories with comma and srounded by single quote
- Prevent add_filter being applied to wp-admin pages
- Translate custom order status through a filter?
- Using preg_replace() with the_content filter
- apply_filters(‘get_the_content’, $content) + Except
- Filter everything from content except output of a shortcode
- 404/500 error on content images if Referer header is from another domain [closed]
- Is there a way to globallly apply esc_html( … ) to all inputs and anchors to filter out XSS markup?
- Filter get_page_by_path()
- Handle multiple parameters in filter
- Want to use wp_get_current_user() in query filter
- WP 4.5 hide core customizer sections
- Apply wordpress filter checking category
- Custom nav walker: How to acces the $args parameter?
- How to stop the deduction in “wp_term_taxonomy” count, when the post is deleted?
- alternative to the_content filter
- How to set a filter search for categories of blog posts in wordpress
- Same URL for portfolio and for a page creates 404 error. Is there any filter that i can use for a child page?
- Filter widget_posts_args not working
- How can I filter the comment action links so that I can display the actions links based on user capabilities?
- Adding link options in insert/edit link dialog window
- Database & Post Search
- How can I change the button text of a custom widget?
- WordPress Tag Cloud Filter Prevents Widget HTML from loading
- Using add_filters() , apply_filter(), add_action() and do_action() in extending a plugin
- Auto-generated excerpt with shortcode and read more button/text link
- ‘the_content’ Filter delivers empty string with lengh (608)
- Output dynamic_sidebar_params in wp_head
- How to sort posts according to meta value?
- Converting restricted html in comments to bbcode
- Change shortcode output (filter?)
- How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?
- How to replace all images in all posts and pages with a different size?
- How to add a class to Buddypress avatars in the Activity stream? [closed]
- using posts_where for meta data on pre_get_posts
- Updating User Profile on Registration
- remove_filter excerpt_more from a plugin class
- ACF Load Field Groups Programmatically [closed]
- Why does using excerpt_more filter change link location?
- How to elect position of new item output in a dropdown when using add_filter
- Query Multiple Filters, one with Meta
- How to remove a filter that is an object method?
- Search and Filter Using Custom Post Type, Custom Taxonomy, and Advanced Custom Fields