# Form Return URL Help

**URL:** <https://community.hubspot.com/t/form-return-url-help/33006>\
**Category:** CMS Development\
**Created:** [March 11, 2021, 6:19am UTC](https://community.hubspot.com/t/form-return-url-help/33006 "2021-03-11T06:19:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elyssa1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/elyssa1/32/101739_2.png) [@elyssa1](https://community.hubspot.com/u/elyssa1)\
**Post date:** [March 11, 2021, 6:19am UTC](https://community.hubspot.com/t/form-return-url-help/33006/1 "2021-03-11T06:19:39Z")

</div>

I have a client who has a paid version of hubspot and they want to embed a hubspot form on a WordPress website … I need the return URL to be the same URL where the request came from along with a custom query added at the end of it … like ?success .. is there a way to set the http referrer as the return url? if so what’s the code to place in the return URL section?  
We will have multiple pages with this form and so all the return urls need to simply return back to the page url with ?success added at the end  
Can anyone advise if this is even possible?  
the reason for this query string url is because we want to hide content on the page and show it only after the form has been submitted …i got all that stuff figured out but just need the return url to work as mentioned above.  
thanks for any assistance and guidance!  
Elyssa

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 11, 2021, 7:00pm UTC](https://community.hubspot.com/t/form-return-url-help/33006/2 "2021-03-11T19:00:56Z")

</div>

Heyo @elyssa1

Have you looked the _redirectUrl_ Attribute on referenced on [this page](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options)?

Curious to know how it works out. @piersg probably has better ideas than me, though. He always does 😥

---

<div class="post-metadata">

**Author:** ![elyssa1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/elyssa1/32/101739_2.png) [@elyssa1](https://community.hubspot.com/u/elyssa1)\
**Post date:** [March 11, 2021, 7:05pm UTC](https://community.hubspot.com/t/form-return-url-help/33006/3 "2021-03-11T19:05:05Z")

</div>

Thanks @dennisedson .. that all looks like klingon to me lol …

I wouldn’t even know where to add any code or how to write the code.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 12, 2021, 4:14pm UTC](https://community.hubspot.com/t/form-return-url-help/33006/4 "2021-03-12T16:14:44Z")

</div>

No time like the present to learn klingon 🙃

Presently, how are you adding your forms to the Wordpress site?

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [March 15, 2021, 10:50am UTC](https://community.hubspot.com/t/form-return-url-help/33006/5 "2021-03-15T10:50:50Z")

</div>

Hi @elyssa1, if I understand you correctly, after submitting the form you want the user to be redirected back to the same page they submitted form on, but with they query parameter ‘?success’ at the end of it? e.g. if they submit form on /landing-page you want them to be redirected to /landing-page?success. If that’s correct, this embed code should work:

```lia-code-sample
<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
hbspt.forms.create({
 portalId: '[THEIR PORTAL ID]',
 formId: '[THE FORM ID]',
 onFormSubmitted: function() {
 window.location = window.location.href + '?success'
 }
});
</script>

```
