WordPress.org

Ready to get started?Download WordPress

Forums

Redirect after comment not working? (1 post)

  1. Ollie1700
    Member
    Posted 11 months ago #

    Hi there,

    I'm having an issue where attempting to redirect after commenting isn't working on my server. Locally it works fine (with two different methods i've tried) but as soon as I upload it to my actual website it doesn't work.
    Basically, I've made a custom blog page where I embed the latest wp blog and have included the comment form below. I edited the code at the bottom of wp-comments-post.php

    $redirect_to_comments = 'mywebsite.com/blog.php#comments';
    $location = apply_filters('comment_post_redirect', $redirect_to_comments);

    This works fine locally but when I use it on my actual site it just redirects to the wordpress login page.

    Any help will be greatly appreciated.

Reply

You must log in to post.

About this Topic