User Notices
Settings
After installation, navigate to User Notices > Settings.
License
- License ID: Enter your license ID and save to validate.
General
- Delete All User Interaction Data on Uninstall: We log dismissals and actions taken in a database table called
wp_user_notices
(assumingwp_
is your database prefix). This option will delete the table when you uninstall the plugin.
Example Notices
Navigate to User Notices > Examples.
You can jump right into creating a notice by installing one of the pre-built notices shown here. You can then edit the notice to your liking or delete it if you change your mind.

Creating a Notice
Navigate to User Notices > Add New User Notice.
- Title: Enter a title for your own records; it will not be displayed on the notice.
- Content: Enter your message into the editor like you would any other post.
- You may change the background color using the "Background Color" button.
- You can also add dynamic content with merge tags; use the "Merge Tags" dropdown to insert a merge tag into your content.
- Action Buttons: You can add buttons to your notice to use like a survey or to log responses. Responses will be shown in the "Interactions" section at the bottom of the page. Leave the button text blank if you don't want to use buttons. If you add a form to the body content above, the submit button will act as an action button as well.
- Button Text: The text on the button
- Background Color: The background color of the button
- Text Color: The text color of the button
- URL: If specified, the user will be redirected to this URL when clicking on the button, otherwise it will simply close the notice.
- Meta Key: Developers can also add a meta key to log the action on the user's meta. By default, it will add the meta key with
1 (true)
as the value. If you want to customize the value, you can do so using theusernotices_save_metakey_value
hook. Leave button text blank if you don't want to use buttons. If you add a form to the body content above, the submit button will act as an action button as well.
- Site Location: This is the page or pages that you want your notice to show up on.
- All Pages
- Homepage Only
- Specific Post Types: If selected, a list of post types will appear for you to choose from.
- Specific Posts & Pages: If selected, you will be asked to list post IDs (comma-separated).
- Shortcode: Notices for all other site locations are loaded into the footer and then repositioned with CSS and/or JavaScript. Choosing the shortcode option prevents it from loading there. Instead you will need to use the shortcode
[user_notice id="" force_display="true"]
to display the notice where you want it. Set theforce_display
parameter totrue
to override other conditions during testing only, then set it tofalse
or remove it altogether to allow the conditional settings to take place.
- Screen Location: This is where the notice will appear on the screen.
- Top: Floats the notice on the top of the screen even when they scroll.
- Above Content: Displays the notice underneath the header and right above the content.
- Below Content: Displays the notice underneath the content right above the footer.
- Bottom: Floats the notice on the bottom of the screen even when they scroll.
- Pop-Up Modal: The notice will appear in the center of the screen with the rest of the page darkened in the background, requiring closure or clicking on a button to make it go away.
- Pop-Up Alert: The notice will appear in a JavaScript alert with plain text and an "OK" button. This option does not allow for custom action buttons or formatting. It also does not track when someone clicks the "OK" button.
- Developer Console: The notice is hidden inside the developer console. Really, this option is there for testing purposes or for developers to have some fun. Rarely will anyone else actually ever see it.
- Audience Type: Who will see your notice
- Everyone
- Logged-In Members
- Logged-Out Members
- Specific Roles: If selected, a list of roles will appear for you to choose from.
- Specific Users: If selected, you will be asked to list user IDs, email addresses (of logged-in users) and/or IP addresses (comma-separated). The IP address option is there if you have tracked a user by IP using other means and want to send them a message specifically.
- Scheduling: You may schedule your notice to show up at specified dates and times. The timezone is based on your site settings (located in Settings > General). You may enter only a start date or end date, but you can not enter times without dates. If a start time is not specified,
00:00:00
will be used by default. If an end time is not specified,23:59:59
will be used by default. - Delay: You can specify the number of seconds you want the notice to wait before displaying on the page.
- Allow Dismissing: Adds a little × button at the top-right of the notice so they can close it. (RECOMMENDED)
- Hide After Action Taken: Actions include any buttons that the user clicks on. The notice will close regardless, but if this is disabled the notice will appear again the next time they load the page. (RECOMMENDED)
- Debug Notice: If your notice is not showing up where you expect it to, you can enable this and look in the developer console on the page to see the reason.
- Interactions: The total number of dismissals and actions taken will appear in this section.
Displaying Your Notices
After setting up your notice, be sure to Publish it.
If you selected "Shortcode" as your site location, then you'll need to copy the provided shortcode (e.g. [user_notice id="" force_display="true"]
) and paste it where you want it to be displayed.
For all other site locations, just go to a page that your site location specifies. If you did not choose a different user as the audience, you should see it.
You can hide a notice altogether by changing the status to Draft.
Troubleshooting
If you have enabled "Allow Dismissing" and you dismiss the notice, you will no longer see it unless you disable this option.
If you have enabled "Hide After Action Taken" and you click on one of the action buttons you added, you will no longer see the notice unless you disable this option.
If your notice is not showing up and you can't figure out why, go back to your notice's settings and enable the "Debug Notice" option. Then go back to the page you want and open your developer console. In the console you, you should see a message that looks like Notice #{ID}| {Reason}
. The reason will be why the notice is not appearing on the page. If this message is not appearing, double-check that the "Debug Notice" option has been enabled and saved, and that you are looking in the right place for the reason.
To open the developer console in most browsers, right-click anywhere on a webpage and select "Inspect" (or "Inspect Element"), or use the keyboard shortcut Ctrl + Shift + J
on Windows/Linux or Cmd + Option + J
on Mac; once the console appears, you can usually find the "Console" tab to view the message.
Resetting Notices for Specific Users
Each time a user dismisses a notice or clicks on an action button, it is logged in the database with a timestamp of when they did so. It is used to prevent the notice from appearing over and over again if you don't want it to. Also, to keep track of who did what if you need to log member acknowledgements, etc.
You can clear all logs for a specific user by editing their profile on the backend and clicking on the "Clear All User Logs" button. This will not reduce the total counts on the interactions section of the notice settings; it will only affect the user specifically.
If a notice is deleted, all database records for that notice will also be deleted.
Interactions Page
Navigation to User Notices > Interactions.
On this page you can see a list of all user interactions in order of most recent.
- You can filter by Notice from the
-- All Notices --
Dropdown. - You can filter by Type from the
-- All Types --
Dropdown. - You can filter by User from the
User ID, Email or IP Address
text field.- If you want to look up all guests that are not logged in, you can enter
0
as the User ID.
- If you want to look up all guests that are not logged in, you can enter
- Clicking on the Notice title will go to the notice edit page.
- Clicking on a logged-in user's name will take you to the user's profile edit page.
- Clicking on a guest's IP address will open a new browser tab with IP lookup details.
- You can also change the number of items per page from the drop down at the bottom left of the page.
Report Page
Navigation to User Notices > Report.
This page include some insights on notice interactions.
- Top Notices Clicked: Shows the top 10 notices with the most amount of action button clicks.
- Top Notices Dismissed: Shows the top 10 notices with the most dismissals.
- Top Users Taking Action: Shows the top 10 users clicking the most action buttons.
- Actions Taken by Type: A bar graph showing how many dismissals and actions have been taken.