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 to rearrange fields in comment_form()
- Trouble understanding apply_filters()
- Commenting in user profile page?
- How do I delete all comments from a specific old blog post?
- Removing the “Website” Field from Comments and Replies?
- How to load and show comments with AJAX instead of pagination?
- Comments not appearing at all
- Send data to 3rd party api with wp_remote_post on wp_login
- Is there an action for when permalinks are rebuilt?
- How can I log a user out of WordPress before the page loads?
- Hook/Filter before and after comments
- Comment form validation
- Send an email when custom post type category is changed
- I have tried using Plugins to remove 72K comments with no success
- Display commenter’s registration date on comments?
- show un-approved comments at wordpress front end
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- WP Admin Bar frontend issue with dashicon deregister
- How to add consent checkbox in comment section
- How to add pagination to comments?
- add_action for lost_password or modify wp-login.php?action=lostpassword
- Add my own function to existing WooCommerce hook
- How to get replies of a comment?
- Share comment to twitter after publishing [closed]
- changing comment-page-# to something like review-page-#
- show if comment is in moderation
- Hook to See if Comment got a Reply?
- Should action callbacks start with a verb?
- Deleting the attached “comment replies” when trashing a comment
- How can I get a list of comments by target
- Load comments.php template outside the post loop
- Auto-fill Custom comment fields
- Highlighting the current users comment
- TinyMCE as comment editor – encoding issues
- How to auto empty comment trash after X days
- How to pass arguments to add_action() or retrieve return value of called function?
- Control panel loads slowly due to 2 slow queries on comment table
- Display complete comment section via post ID
- Save User Meta Email Address in Lowercase
- Comment Pagination Behavior wp_list_comments() – comment ordering and pagination
- Check if comment was successfully submited
- After Submitting Comment Form Shows an Empy Page in WordPress
- Unique User for all visitor, but possibility to comment with unique name
- comments_array filter doesn’t work in some themes
- Redirect when click on “response” in comment section
- Link to a User’s Forum Profile From Their Comment
- if user role is then echo text
- strange behavior with comment position
- Safely editing core files
- Show comment pop up links as text only
- Add Different Actions To Different Page’s wp_footer
- Displaying comments on pages distinguished by GET IDs
- Is there a hook to update / replace values in the “Enable threaded (nested) comments x levels deep” drop down?
- Update comment meta for all comments of specific post
- How to find list of all functions bind to a particular hook from my plugin?
- How to change comment texts that has a specific comment_ID – Hook into comment
- Add action to custom Function
- counting trackbacks, pingbacks and comments of a post
- Adding comments section to website integrated WordPress instance
- How to Define Custom Number of Items in Comment Feed
- Empty comments field or
- infinite loop on page with comments after changing comments.php and header.php
- What templates/funtions needed in custom theme to allow comments the new 3.0 way
- Default Gravatar not showing for pings
- How include comment and post count of user in this custom query
- Hooking into the HTML header container
- Disallow Comments
- {status}_{post_type} does not run correctly?
- Which action hook to update custom field at network/site-info.php in multisite on update site info
- Allowing comments on author pages
- Comment section not appearing on posts
- How can I see whether a commenter has subscribed to be notified of replies / other comments to a post
- Object oriented programming, add_action in constructor not firing
- Where is the Leave a Comment link set
- Disable comment moderation in multisite
- Auto disable comments with custom field
- I want to fill the comment with the comment count?
- delete user not working
- How to remove or customize “Comment” in comments form?
- check if a comment was made by a registered user
- Get approved comments or comments that the author is me
- Show/Hide comments