WPForms Notification Smart Tags
-
When users subscribe to my blog, I use the “Embedded post/page title” smart tag to display the originating page the user was on when they elected to subscribe. However, when the user subscribes using the subscribe widget in the right sidebar of my page, the embedded page title is simply “Subscribe to Blog” rather than the blog post content in the main page they are viewing. I’ve tried using “Embedded post/page URL” as well, but it still returns the “subscribe to blog” URL rather than the URL of the blog post page they’re viewing when subscribing using the sidebar widget. I note that when they subscribe to the blog using the widget embedded within the blog post, it does return the correct page title or URL. I am using the GeneratePress theme. Thanks in advance for your assistance.
The page I need help with: [log in to see the link]
-
Hi @myfamilypattern,
Thanks for reaching out!
I’ve looked into the behavior you described while using the GeneratePress theme. I tested the
{page_title}Smart Tag within a sidebar widget on my own setup, but I was unable to reproduce the issue; the Smart Tag correctly pulled the title of the blog post being viewed.You can see my test results in this screencast: https://a.supportally.com/v/hYQzng
To help me narrow down why this might be happening on your site, could you please check a few things for me?
- Check Versions: Please ensure you are running the latest version of the GeneratePress theme (3.6.1) and WPForms Lite (1.9.9.2).
- How is the widget added?: Could you let me know exactly how you added the form to your sidebar (e.g., using the WPForms Block, a Shortcode, or a Legacy Widget)?
- Page Details: Are the pages where this is happening standard blog posts, or are they built using a specific page builder or template?
If possible, please share screenshots or a video showing the issue and your settings.
This information may help us to reproduce the issue you’re experiencing and provide further information.
Thanks!
Thanks, Ralden.
I have confirmed that I am running 3.6.1 and 1.9.9.2 versions.
I have taken several screenshots. I’ve uploaded the images to my Google Drive, but I’m unsure if you can actually view them. From my viewing of the this post, it doesn’t appear that you can. Any advice on properly sharing them is appreciated.
The first of is the top of a post where you can see the subscribe button the in the right sidebar. This is the one that doesn’t work correctly. https://drive.google.com/file/d/1GBPfyobLvwP271G3gdaCfYW82wXCB2Jh/view?usp=drive_link
The next image is the bottom of post where the imbedded subscribe is found, and this is the one that works correctly.
https://drive.google.com/file/d/1VIBfHmE5Bx5Q58ctP3cxotmAj83CKBO5/view?usp=drive_link
The final image is the window that opens once the subscribe button is selected in the first image (right sidebar). When someone subscribes this way, a new window appears, and I note that the displayed URL on this page is correctly returned, i.e., “subscribe to blog”. However, I wish it to communicate the page they were just on. Is there a way to address this issue?
https://drive.google.com/file/d/1KNKsaVD8DetwzN1Pp4jK94a7eH5HMrwi/view?usp=drive_link
Rick
-
This reply was modified 3 months, 3 weeks ago by
myfamilypattern.
-
This reply was modified 3 months, 3 weeks ago by
myfamilypattern.
Hi @myfamilypattern,
Thank you for confirming those versions and for providing the screenshots!
The reason the Smart Tags are returning “Subscribe to Blog” is that your sidebar currently uses a button that redirects the user to a new page. Since the form is actually being submitted on that new “Subscribe” page, the Smart Tags correctly identify that page as the source.
To capture the original page title and URL, you have two options:
Option 1: Use “Prefill by URL” (Recommended)
This method uses a small “bridge” form in your sidebar to pass data to your main subscription form.
- Create a Sidebar Form: Create a new form. In Settings > General, change the Submit Button Text to “Subscribe to Blog”.
- Add Hidden Fields: Add two Single Line Text fields to this new form.
- Set the Default Value of the first to
{page_title}and the second to{page_url}. - Hide these fields by adding
wpforms-field-hiddento the CSS Classes box in the field settings (documentation).
- Set the Default Value of the first to
- Prepare your Main Form (ID #711): On the form that you’re using on the “Subscribe to Blog” page, add two similar hidden Single Line Text fields.
- Enable Prefill: In the settings for form #711, enable Prefill by URL under Settings > General (documentation).
- Set the Redirect: In your new sidebar form, go to Settings > Confirmations. Set the type to Go to URL and use a query string like this:
https://yourdomain/subscribe-to-blog/?wpf711_3={field_id="1"}&wpf711_4={field_id="2"}(Replace the numbers with your actual field IDs; “1” and “2” from the fields in the new form; “3” and “4” from the new fields in the form ID #711).
You can find the full technical guide for this here: How to Use Query Strings to Pre-Populate Form Fields
Option 2: Custom URL Button
If you prefer to keep using a simple button in the sidebar, you can manually add query strings to the link. However, this is less dynamic than Option 1 as it won’t automatically update for every single post unless your theme supports dynamic links.
I hope this helps!
Hi @myfamilypattern,
We haven’t heard back from you in a few days, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.
Thanks!
Sorry! It’s just hard to make changes during the week. I’ve read your response and will try your first option once I have time to see what it entails. I will follow up with how it went.
I tried option 1, which I prefer. However, I’m struggling with the instruction. I create a new form, but I’m unsure if it is “sidebar” form. I also, don’t know what it means to “add two single line text fields” that are hidden. I’m sorry, but I’m not able to follow the instructions. I’ve read the links further in your reply, but I don’t think I can even get to these steps because a) I’m not sure I created a sidebar form and b) I don’t know what it means to add a hidden field or to set the default value.
Hi @myfamilypattern,
I’m sorry for the confusion with those instructions! I definitely understand how terms like “sidebar form” or “hidden fields” can feel a bit overwhelming when you’re first getting started.
I’ve recorded a screencast to show you exactly how to follow these steps within the WPForms builder: https://a.supportally.com/v/R65DsH.
I hope the screencast helps! Please let me know if you have any other questions as you work through this.
Thank you. I will review the video and let you know how I make out. Thanks for taking the time to make the video!
Hi @myfamilypattern,
You’re very welcome!
If you’d like more help with using WPForms Lite, please don’t hesitate to let us know.
Thanks!
Thanks again for the video. It was very helpful. I was able to complete it, but now the form “Subscribe to Blog” button is not the same as my other buttons, which are black and oval. How can I change the button style without upgrading to WPForms Pro, which I cannot afford?
Never mind my last question. I figured it out. 🙂
Hi @myfamilypattern,
Great to hear that you figured out how to adjust the button. Thanks so much for letting me know!
Please note that you can customize the style of your forms using our Form Themes feature within the Form Builder.
If you’d like more help with using WPForms Lite, please feel free to reach out.
Thanks!
You must be logged in to reply to this topic.