How to delete a transient on post/page publish?
I am considering it for publication of a new post. Add the below code in your active theme’s functions.php file. function wpse_delete_query_transient( $post ) { // Deletes the transient when a new post is published delete_transient( ‘d_results’ ); } add_action( ‘new_to_publish’, ‘wpse_delete_query_transient’ ); This will delete the transient every time a new post is published. … Read more