WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was editing a wordpress theme. Where i need to replace default wp login link with custom login link.

Problem is, comment_reply_link() function is returning the default link. And i dont want to edit wp-include/comment-template.php

Is there any other way, so that without manipulation of any wordpress file i can replace the default login url.

I already had tried

apply_filters('login_url', $login_url,get_permalink());

before calling comment_reply_link(). But it is not filtering resulting URL.

share|improve this question
up vote 1 down vote accepted

you can simple make a check if user is logged in and show him the reply button, if is not you can show him a custom link to your login file.

something like this:

<?php if ( !is_user_logged_in() ) : ?>
    <a href="<?php bloginfo('url'); ?>/login"><?php _e('Reply', 'artdev'); ?></a>
<?php else : ?>
    <?php comment_reply_link() ?>
<?php endif ?>  
share|improve this answer

I am not sure if you copy/pasted wrong line or misunderstanding how to add filter. apply_filters() runs actual hook, to attach your function to the hook you use add_filter().

It should be something like that:


function custom_login_url($login_url) {

    return 'your url';
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.