{CODICTS} Snippets is now available

WordPress Questionaire

The {CODICTS} WordPress Questionaire plugin adds a questionnaire feature to WordPress posts and pages. It enables authorized users (based on role or post ownership) to create custom question sets on any post or page using a floating popup builder, and then display those questions to visitors via a shortcode. Visitors can answer the questions directly on the page, and their responses are emailed to the site admin and/or the listing owner — all without page reloads.

Requirements

RequirementDetails
Voxel ThemeRecommended (the plugin checks for Voxel, but the core functionality works independently)

No child theme required. This plugin does not override any template files. It operates through a shortcode, a floating frontend builder, and an admin settings page.

Installation & Activation

Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.

After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.

After activation, navigate to “Questionaire” in the WordPress admin sidebar to configure which user roles can create questionnaires and how email notifications are sent.


Key Features

FeatureDescription
Question BuilderA floating popup UI on the frontend that allows authorized users to add, edit, reorder, and remove questions on any post or page.
Shortcode RenderingDisplay questions to visitors using the [codicts-questionaire] shortcode. Visitors answer directly on the page.
Role-Based VisibilityControl which WordPress user roles see the question builder button.
Listing Owner ToggleOptionally allow post/listing owners to manage their own questionnaires regardless of role.
Email NotificationsSubmitted answers are emailed to the site admin and/or the post author as formatted Q&A pairs.
AJAX PoweredBoth question saving and answer submission happen without page reloads.
Auto-Hide ContainerWhen no questions exist for a post, the shortcode can automatically hide its parent container via a configurable CSS class.
Guest SubmissionsBoth logged-in and logged-out visitors can submit answers.

How It Works

The plugin has two distinct user flows:

Flow 1 — Creating Questions (Admin/Owner)

1. An authorized user (based on role settings or post ownership) visits a post or page on the frontend.

2. A floating “Add Questionaire?” button appears on the left side of the screen.

3. Clicking the button opens a popup where the user can add, edit, and remove questions.

4. Clicking “Save Questions” stores the questions on the post. A success message instructs the user to add the [codicts-questionaire] shortcode to the page.

Flow 2 — Answering Questions (Visitor)

1. A visitor views a post or page containing the [codicts-questionaire] shortcode.

2. The questions are displayed as numbered cards with an “Add your answers?” button.

3. Clicking the button reveals answer textareas beneath each question. The button changes to “Submit Answers.”

4. After filling in all answers and clicking submit, the answers are sent via AJAX and emailed to the configured recipients. A success confirmation appears.


Settings Page

Navigate to “Questionaire” in the WordPress admin sidebar.

SettingDescription
Visible RolesSelect which WordPress user roles can see the floating “Add Questionaire?” button on the frontend. All registered roles are listed with toggle switches (e.g., Administrator, Editor, Subscriber).
Visible User — Listing OwnerWhen enabled, the post/listing author will always see the question builder button on their own posts, regardless of their role setting.
Email NotificationsConfigure who receives email when a visitor submits answers: Send to Admin (site admin email) and/or Send to Listing Owner (post author email). You can enable both.

Creating a Questionnaire

Who Can Create Questions

The floating question builder button appears when all of the following are true:

ConditionDetails
Logged inThe user must be logged in to WordPress.
Single post or pageThe user must be viewing a single post or page (not an archive, category, or search page).
AuthorizedThe user’s role is enabled in the Visible Roles setting, OR the user is the post author and the “Listing Owner” setting is enabled.

Using the Question Builder

1. Visit a post or page on the frontend while logged in with an authorized role.

2. Click the “Add Questionaire?” button on the left side of the screen.

3. A popup opens with a blank question textarea (or pre-populated with existing questions if the post already has a questionnaire).

4. Manage your questions:

ActionHow
Add a questionClick “Add More” to append a new blank question. Questions are auto-numbered.
Edit a questionType directly in any question’s textarea.
Remove a questionClick the red “remove” badge on any question (except the first). Remaining questions are automatically renumbered.

5. Click “Save Questions”. A green success banner confirms the save and displays the shortcode to use:

[codicts-questionaire]

6. Edit the post or page and paste the shortcode wherever you want the questionnaire to appear.

Tip: To remove all questions from a post, clear all question textareas (leave them empty) and click “Save Questions.” Empty questions are excluded, effectively removing the questionnaire.


Displaying Questions (Shortcode)

Place this shortcode in the post or page content where you want the questionnaire to appear:

[codicts-questionaire]

Shortcode Attributes

AttributeDefaultDescription
hide_css_classcodicts-questionnaire-containerCSS class of a parent container to hide when no questions exist for the current post.

Example with custom hide class:

[codicts-questionaire hide_css_class="my-wrapper-class"]

Behavior

ScenarioWhat Happens
Questions existQuestions are rendered as numbered cards with an “Add your answers?” button. Visitors can expand answer textareas and submit their responses.
No questionsThe shortcode injects a CSS rule that hides the element with the specified hide_css_class. This allows you to wrap the shortcode in a container with a class name and have it automatically hidden when there are no questions.

Answering Questions (Visitor Experience)

1. Questions appear as numbered cards on the page.

2. The visitor clicks “Add your answers?”. Answer textareas slide down beneath each question and the button changes to “Submit Answers.”

3. The visitor types their answers. All questions must be answered — if any are left blank, the first empty textarea is highlighted in red and focused.

4. Clicking “Submit Answers” sends the responses. A green confirmation banner appears:

“Answer Submitted! We appreciate you taking the time to answer our questions. Thank you!”

5. The configured email recipients receive an email with the formatted Q&A pairs.

Note: Both logged-in and logged-out visitors can submit answers. No account is required.


Email Notifications

When a visitor submits answers, emails are sent based on the settings page configuration.

RecipientSettingEmail Address Used
Site Admin“Send to Admin” enabledThe admin email from WordPress Settings → General.
Listing Owner“Send to Listing Owner” enabledThe post/listing author’s email address.

The email includes a subject line referencing the post title and an HTML-formatted body with all question-and-answer pairs:

Subject: Your visitor submitted an answer for the listing: Restaurant Name

Below are the answers:

Question 1: What is your name?
Answer: John Doe

Question 2: How did you hear about us?
Answer: Social media

Question 3: Any feedback?
Answer: Great experience!

Note: Email delivery relies on WordPress’s wp_mail() function. Ensure your site has a working email configuration. Consider using an SMTP plugin (e.g., WP Mail SMTP) for reliable delivery.


Example Setup — Listing Questionnaire

1. Activate the plugin. Navigate to “Questionaire” in the admin sidebar.

2. Under Visible Roles, enable “Administrator.” Enable “Listing Owner” so listing owners can manage their own questionnaires. Under Email Notifications, enable both “Send to Admin” and “Send to Listing Owner.” Save.

3. Visit a listing page on the frontend while logged in as an administrator or as the listing owner.

4. Click the “Add Questionaire?” button. In the popup, add three questions: “What is your name?”, “How did you hear about us?”, and “Any feedback?” Click “Save Questions.”

5. Edit the listing (or listing type template) and add the shortcode [codicts-questionaire] to the content area or a content block.

6. A visitor views the listing page and sees the three questions. They click “Add your answers?”, fill in their responses, and click “Submit Answers.”

7. Both the site admin and the listing owner receive an email with the visitor’s formatted responses.


Example Setup — Auto-Hiding When No Questions

If you want the questionnaire section to be completely invisible when no questions have been created, wrap the shortcode in a container with a class name:

<div class="my-questionnaire-section">
    <h3>Have Questions? We'd Love to Hear From You!</h3>

[codicts-questionaire hide_css_class=”my-questionnaire-section”]

</div>

When the post has questions, the entire section (heading + questionnaire) is visible. When there are no questions, the entire my-questionnaire-section container is automatically hidden via CSS.


Frequently Asked Questions

Does this require a child theme?

No. The plugin does not override any template files. It operates through a shortcode, a floating frontend builder, and an admin settings page.

Is there a settings page?

Yes. Navigate to “Questionaire” in the WordPress admin sidebar to configure visible roles, listing owner access, and email notification recipients.

Can visitors answer questions without being logged in?

Yes. Both logged-in and logged-out visitors can submit answers. No account is required.

Who sees the question builder button?

Only logged-in users whose role is enabled in the settings, or post authors when the “Listing Owner” setting is enabled. The button only appears on single post and page views — not on archives or category pages.

How do I remove a questionnaire from a post?

Open the question builder popup, clear all question textareas (leave them empty), and click “Save Questions.” Empty questions are excluded, so an empty set is saved and the shortcode will hide its container.

Can each post have its own unique set of questions?

Yes. Questions are stored per post as post meta. Each post or page has its own independent questionnaire that is managed and displayed separately.

What happens when no questions exist for a post?

The shortcode injects a CSS rule that hides the element with the configured hide_css_class. Use this to wrap the shortcode in a container that automatically disappears when there are no questions.

Who receives the email when answers are submitted?

Based on your settings: the site admin (WordPress admin email), the post/listing author, or both. At least one recipient must be enabled for emails to be sent.

Does the plugin work without the Voxel theme?

The plugin checks for the Voxel theme, but the core questionnaire functionality (builder, shortcode, answer submission, email notifications) works independently on any WordPress site.

Does the plugin create any database tables?

No. Questions are stored as post meta (codicts_questions) on individual posts. Plugin settings are stored as a single entry in the WordPress options table. No custom database tables are created.

What happens when the plugin is deactivated?

The shortcode stops rendering and the question builder button no longer appears. Questions stored in post meta and plugin settings are preserved. Reactivating the plugin restores full functionality with existing data intact.


Troubleshooting

“Add Questionaire?” Button Not Appearing

CauseSolution
Not logged inYou must be logged in to WordPress to see the question builder button.
Role not enabledNavigate to Questionaire settings and ensure your user role is toggled on under Visible Roles.
Not the post authorIf the “Listing Owner” setting is enabled but you’re not the author of the current post, the button won’t appear (unless your role is also enabled).
Not a single post/pageThe button only appears on single post and page views. It does not appear on archives, category pages, or the homepage (unless it’s set as a static page).

Shortcode Shows Nothing / Container Is Hidden

CauseSolution
No questions savedThe shortcode hides its container when no questions exist for the current post. Use the question builder to add questions first, then the shortcode will render them.
Wrong postQuestions are stored per post. Ensure the shortcode is placed on the same post where questions were created.

Email Notifications Not Being Sent

CauseSolution
No recipients enabledNavigate to Questionaire settings and ensure at least one notification recipient is enabled (“Send to Admin” and/or “Send to Listing Owner”).
wp_mail() not configuredThe plugin uses WordPress’s wp_mail(). Install an SMTP plugin (e.g., WP Mail SMTP) for reliable email delivery.
Server blocks outgoing emailSome hosts block outgoing email from PHP. Check with your hosting provider or use a transactional email service.

Question Builder Popup Doesn’t Close

CauseSolution
Clicking inside the cardClick anywhere on the dark overlay (outside the white card) to close the popup. Clicking inside the card keeps it open by design.

Answer Textarea Highlighted in Red

CauseSolution
Validation errorAll questions must be answered before submitting. The first empty textarea is highlighted in red and focused. Type an answer to clear the error styling.

Answers Not Submitting

CauseSolution
JavaScript errorCheck the browser console (F12 → Console) for errors. Other plugins or themes may conflict with jQuery.
Not all questions answeredAll questions must have answers. Check for any empty textareas.

For further support, visit codicts.com or contact us at support@codicts.com.

CoDicts Co., Ltd. © 2021-2026. All rights reserved