I have ajax login form, and a lost password link that gets it's url with wp_lostpassword_url() function.

When I validate the page I get

Error: & did not start a character reference. (& probably should have been escaped as &.)

On line where that link is. Can that be fixed somehow?

I have woocommerce active so it sends me to woocommerce page for login.

I could create a custom function that will send user to default forgotten password page


But that would be a last resort solution.



The function has to be escaped properly with esc_url().

  • Is this a woocommerce issue? – dingo_d Feb 27 '15 at 12:40

Please post the line of code that uses wp_lostpassword_url()

(Can't comment not enough rep :()

  • It's just <a class="lost" href="<?php echo wp_lostpassword_url(); ?>"><?php esc_attr_e('Lost your password?','theme') ?></a> – dingo_d Feb 27 '15 at 13:00
  • Can you try <a class="lost" href="<?php echo urlencode(wp_lostpassword_url()); ?>"><?php esc_attr_e('Lost your password?','theme') ?></a> – Jason Murray Feb 27 '15 at 13:07
  • urlencode messed up my url, but apparently esc_url() fixed the issue :) Thanks for the tip :) – dingo_d Feb 27 '15 at 13:19
  • No problem. Wonder what the issue is. I know WooCommerce pages do parse code differently such as line breaks etc. – Jason Murray Feb 27 '15 at 13:24
  • It turns out that it's just how it should go: github.com/woothemes/woocommerce/… – dingo_d Feb 27 '15 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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