ES EN
Home Guides WordPress

How to add a quiz to a WordPress website

Adding the quiz with the button from the LeadForms editor
Copy the script code
In the quiz editor, open “Publish” → “On website”, choose the “Button” type and click “Copy” under the code for the <head> section.
LeadForms “Publish” tab: “On website” mode and embed type selection LeadForms initialization code for the head section, with the “Copy” button
Open the post in WordPress
In the WordPress dashboard, go to “Posts” → “All Posts” and open the one where you want the quiz.
WordPress dashboard: “Posts” → “All Posts”
Create a new block
In the post editor, click the “+” icon (“Add block”) right where you want the quiz.
WordPress editor: the “+” button for adding a block
Choose the “Custom HTML” block and paste the initialization code
In the block list, choose “Custom HTML” and paste the initialization code into it. If you don't see it in the list, use the block search or “Browse all”.
Block picker in WordPress: the “Custom HTML” block
Go back to LeadForms and copy the button code
Below the script for the <head> section there is a second code block, “Paste this code anywhere on the page”. That is the one that renders the button. Click “Copy”.
Publishing in LeadForms: the second code block, to paste anywhere on the page
Paste the button code and update the post
Go back to the post editor and paste the button code into the same “Custom HTML” block where you put the initialization code, right after it. Click “Update”.
Done! The quiz is live
A button appears on the page, and clicking it opens the quiz.
Published WordPress post: the button opens the quiz
If you prefer your own button
Use this option when the quiz should open from a button that already exists on your page rather than from the LeadForms code.
You still need the script for the <head> section: paste only that one, as in steps 1 to 3 above. The button code is not used here.
Copy the button link
In the “Custom button” subtab, copy the link in the #popup:Leadforms_ID format.
“Custom button” tab in LeadForms: #popup:Leadforms_ID link and the onclick option
Add the button
Go back to editing the post and insert a button. Give it a label and paste the copied link into the “URL” field.
Publish the page
Having trouble with the setup?
If something doesn't work, and we'll sort it out with you.

Still have questions? Write to us

Name *
* Required field
Email *
* Required field
Message
Write to us!
We reply within 30 seconds