Skip to content

Fix/add redirect url#70759

Open
dhananjaykuber wants to merge 3 commits intoWordPress:trunkfrom
dhananjaykuber:fix/add-redirect-url
Open

Fix/add redirect url#70759
dhananjaykuber wants to merge 3 commits intoWordPress:trunkfrom
dhananjaykuber:fix/add-redirect-url

Conversation

@dhananjaykuber
Copy link
Copy Markdown
Contributor

@dhananjaykuber dhananjaykuber commented Jul 17, 2025

Issues #58096

What?

Adds a redirect URL option to the experimental form block, allowing users to specify where visitors should be redirected after successful form submission.

Why?

Currently, the form block don't supports custom URL after form submission. User need to redirect visitors to custom thank-you pages, confirmation pages, or external URLs after form submission for better user experience and conversion tracking.

How?

The implementation adds a new redirectUrl attribute to the form block with the following components:

Testing Instructions

  • Open a post or page in the block editor
  • Insert a Form block from the block inserter
  • In the Inspector Controls sidebar, locate the "Redirect URL" field
  • Enter a redirect URL (e.g., /thank-you or https://example.com/success)
  • Configure form submission method (email) and add a recipient email
  • Save the post and view it on the frontend
  • Fill out the form and submit it
  • Verify that you are redirected to the specified URL after successful submission

Screenshots or screencast

Screenshot 2025-07-17 at 5 25 12 PM Screenshot 2025-07-17 at 5 25 26 PM

@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dhananjaykuber <dhananjaykuber@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Form (experimental) Affects the form block labels Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Form (experimental) Affects the form block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants