Skip to:

Filter to Change Login URL

  • Trying to find the filter to change the URL for “You must log in to post.” to an alternate URL since I am using a custom WP user management plugin and want all users to use custom WP login page.

    Tried using the user_link and user_profile_link filters found at but neither worked.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I did this on a bbPress install recently… but rather than doing anything tricky programmatically, I just changed the links in the theme.

    It worked great!

    *ponder* dbone, if they use the must login to post link, they stay on the same page as they already are, so it shouldn’t be an issue, right?

    I mean, all you really have to do is redirect registration to your profile manager tool.

    Which file did you edit? I was not able to find it in the default theme.

    I did find the code that creates the link in /bb-includes/function-bbtemplate.php, post_form(), line 311 for version 1.0.1.

    I think it was the login.php file.

    Definitely don’t edit any pages in bb-includes… create a /my-templates/ folder as described here!

    I should have been more clear on where I am trying to update the link. After clicking on a forum from the front page the following is displayed at the bottom:

    New Topic in this Forum

    You must log in to post.

    Looked in login.php and couldn’t find the line in question (I do have a template in my-templates).

    I can try using the action bb_init but I don’t know how to pull in the content to apply a regex similar to WPs the_content filter.

    Not sure if this is the best method but I don’t have more time to research and here is what I came up with:

    1. Create a new file; /my-plugins/bb-template.php

    2. Code:

    add_filter('bb_template', '_bb_template');

    function _bb_template($template)
    if (preg_match('/login.php/i', $template))
    header('Location: /myurl/');

    return $template;

    3. Activate in bb-admin

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar