Add a poll to WordPress and other CMS
Add a PHPPoll poll to WordPress, Wix, Joomla, Shopify or any CMS using a Custom HTML block and the JavaScript embed code. Step-by-step with tips for each platform.
You do not need a plugin to use PHPPoll with a content management system. Every CMS that accepts HTML can display a poll through the JavaScript embed code. Your poll data stays on your own server.
WordPress
- In PHPPoll open Embed & share, select the poll and copy the JavaScript embed code.
- In WordPress edit the post or page. Click + and add a Custom HTML block.
- Paste the code into the block and click Preview. The poll appears.
- Publish or update the page.
To show a poll in the sidebar or footer, add a Custom HTML widget under Appearance → Widgets and paste the same code.
Some security plugins or user roles strip <script> tags. In that case use the iframe code from the same page. See Embed a poll with an iframe.
Other platforms
| Platform | Where to paste the code |
|---|---|
| Joomla | A Custom HTML module, or the editor in "Code" / source mode. |
| Drupal | A block or text format that allows full HTML. |
| Wix | The Embed code element (HTML). If scripts are not accepted, use the iframe code. |
| Shopify | A Custom Liquid section or the HTML view of a page. |
| Squarespace, Webflow | A Code / Embed block. |
| Static HTML | Directly into the page source. |
Match the poll to your theme
- Choose a theme and accent color on the Embed & share page, so the code matches your site. See Share and embed polls.
- For dark websites select the Dark theme.
Tips
- Place the poll below the introduction of the article, where readers are engaged.
- Embed the same poll in several posts to collect more votes. The statistics show the sources. See Poll statistics and individual votes.
- For the highest speed on PHP-based sites you can use the PHP include instead.
Last updated