Title: constructing login url
Last modified: August 30, 2016

---

# constructing login url

 *  [Brandon DuRette](https://wordpress.org/support/users/wpe_bdurette/)
 * (@wpe_bdurette)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/constructing-login-url/)
 * When constructing the login URL for emails, the plugin uses simple string concatenation.
   This is broken if the underlying URL already contains query parameters:
 * `$login_url = $reset_pass_url = wp_login_url() . '?action=rp&key=' . $key . '&
   login=' . rawurlencode($user->user_login);`
 * WordPress 4.4 included a change that makes it necessary for us (WP Engine) to
   filter the wp_login_url() call and append a query parameter to the result. The
   result is that your plugin is broken on our platform.
 * It should be possible to use the WordPress core function [`add_query_arg`](https://developer.wordpress.org/reference/functions/add_query_arg/)
   to safely construct the URL that you need. This would resolve the breakage on
   our platform, make your plugin more future-proof, and resolve potential conflicts
   with other plugins.
 * Regards,
    Brandon
 * [https://wordpress.org/plugins/welcome-email-editor/](https://wordpress.org/plugins/welcome-email-editor/)

The topic ‘constructing login url’ is closed to new replies.

 * ![](https://ps.w.org/welcome-email-editor/assets/icon-256x256.png?rev=3015931)
 * [Swift SMTP (formerly Welcome Email Editor)](https://wordpress.org/plugins/welcome-email-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/welcome-email-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/welcome-email-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/welcome-email-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/welcome-email-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/welcome-email-editor/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Brandon DuRette](https://wordpress.org/support/users/wpe_bdurette/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/constructing-login-url/)
 * Status: not resolved