Use the filter comment_post_redirect
:
add_filter( 'comment_post_redirect', 'comment_redirect' );
function comment_redirect( $location ) {
$location = 'http://example.com/sample-page';
// or:
// $location = get_page_link( page_ID );
// $location = get_page_link( get_page_by_path( 'sample-page' )->ID )
return $location;
}
Related Posts:
- An action hook where a comment meta is updated
- On WordPress 4.4, how to get the post id using the comment_post hook
- Hook to edit an column on comments screen?
- Altering the pingback functionality
- WP 4.4.1 allow empty comments via add_action ‘pre_comment_on_post’
- WordPress custom form action url
- Auto delete comment if Contains
- Assign author to comment from post edit page
- Comment search plugin
- Alternative to the filter comment_reply_link
- How to use the ‘comments_number’ filter?
- custom hooks before a comment is updated/edited in the database
- Use has_filter on comment_post
- ‘comment_post’ hook doesn’t seem to work? [closed]
- stumped on add_action hook to delete_comment – any ideas?
- How to Trigger comment_form_after action if comment_form() not used
- Comments closed only for contributors
- What filter or action to replace comments or add new comment system
- How do I comment out a block of tags in XML?
- R: Comment out block of code
- Passing a parameter to filter and action functions
- Difference Between Filter and Action Hooks?
- How to know what functions are hooked to an action/filter?
- Why do I get comment spam even with Akismet and Captcha?
- Get a list of all registered actions
- what is correct way to hook when update post
- Is there a hook that runs after a user logs in?
- What tools are available for managing/writing to WordPress? [closed]
- how to limit search to post titles?
- How to enqueue scripts on custom post add/edit pages?
- How can I edit post data before it is saved?
- Difference between do_action and add_action
- How to rearrange fields in comment_form()
- Trouble understanding apply_filters()
- setting comments off as default for pages and custom post types?
- How can I see all the actions attached to an “add_action” hook?
- Which hook should be used to add an action containing a redirect?
- get_template_part vs action hooks in themes
- Why do some hooks not work inside class context?
- Is it possible to pull comments from facebook into your blog?
- Difference between after_setup_theme and init action hooks?
- Is there any action filter/hook for validating a custom field before publishing the post?
- Trigger custom action when setting button pressed
- Filtering the Admin Comments List to Show Only Comments from the Current User?
- Non-threaded comment replies with link to original comment
- Please explain how these hooks work
- Approve comment hook?
- How many filter/action hooks are healthy?
- Commenting in user profile page?
- How to change “You must be logged in to post a comment.”
- comment_post_ID 0 (cannot remove from dashboard)
- Disable comments on all posts/pages
- How do I delete all comments from a specific old blog post?
- Earliest hook to reliably get $post/$posts
- Removing the “Website” Field from Comments and Replies?
- Stop WordPress redirecting comment-page-1 to the post page?
- Importing old Disqus comments into WordPress
- How to add a class to the comment submit button?
- Hook after image is uploaded and image sizes generated
- How to wrap submit button of comment form with div
- What does (10, 2) mean when used with add_filter
- add_action(‘wp_ajax_[action name]’, myfunction) problem
- How to enable comments for pending and draft posts?
- Using WordPress’ WYSIWYG for comments
- Enable Submit Comment Without Page Reload (Using Ajax)?
- What for is the table “wp_commentmeta” exactly?
- WordPress Multisite: Adding actions to only one site
- Getting Post Comments for post ID using WP_Query() and a Custom Loop?
- How to only hook on Single.php after content?
- Add option to disable comments on a per posts basis?
- Resetting comment count
- How to remove action hook done in a plugin from functions.php in my theme?
- Valid characters for actions, hooks and filters
- When importing – failed to import: Invalid post type feedback
- How to change the email notification recipient (user) for new comments?
- Redirect user to a custom url after submitting the comment
- Paginate result set from $wpdb->get_results()
- How to check if a hook is hooked or not?
- Change Comment Author Display Name
- Would switching to InnoDB from MyISAM improve performance of comments table?
- Custom comment type based on thread level
- How to add internal, revision comments to page updates
- Extract image from content and set it as the featured image
- trigger save_post event programmatically
- How to load and show comments with AJAX instead of pagination?
- Linking to Page Showing Only Comments Without Parent Post
- Implementing advanced add_* function wrappers
- Comment Reply javascript
- My add_action (wp_footer, ‘method’) is not calling?
- How do we remove the H3 tag for the reply-title I.D
- Comments not appearing at all
- comments reply script not working
- How to display comment form error messages in the same page
- 3 moderators to approve comment
- How to deal with small scale comment spam on small commercial sites? [closed]
- Hook/action after WP_Query gets posts to query custom tables for post-related meta
- What is the earliest possible hook for safely using `is_front_page`?
- What should I do to make generated avatars different for anonymous comments?
- A plugin where users can comment with Facebook or Twitter or OpenID [closed]
- When can you get current page ID and initialize hooks right after?