I came across Creating Pretty Conversational Form URL Slug which shows you how to create pretty URL landing page slugs. It worked well, however I didn’t want to use the form ID in the url, so I took the code and modified it to use the form title with safe url encoding.
For example, say your form title was Patient Survey
and your landing page prefix was /forms
, this would generate the slug: mydomain.com/forms/patient-survey
.
It automatically converts spaces in the title to dashes (-
) to ensure it’s a valid url.
Landing page code:
Add the code below to functions.php
or code snippet plugin. You shouldn’t need to edit anything in the customFFLandingPageSlug
function.