Date Condition
PersonaliseWP offers powerful personalisation rules as part of its feature-set that allow you to show and hide content based on who they are, where they have come from and their behaviours and actions on your site.
By using personalisation, you can create a more engaging and relevant user experience by tailoring content, recommendations, and interactions to individual preferences. This leads to increased user satisfaction and retention.
Visit Date-Based Personalisation
When a visitor arrives on your site, the plugin will determine the date in the locale that the user is accessing from.
Using this information you can then use date-based rules to show and hide content that is relevant and contextual to them.
For instance, you may wish to show different content to visitors depending on the date that they are accessing your website. Perhaps you are running a promotion or offer through July. You could create the block, and then setup a rule to only show that block from 1st July - 31st July.
Using this method means you don't need to remember to schedule posts to go-live or unpublish them once the promotion ends. It will only show between those dates.
Creating Date-Based Rules
You can access PersonaliseWP's personalisation rule tools by going to WP-Admin > Personalise > Dashboard > Personalisation.
On this screen, you can view a paginated list of all rules currently active and inactive, and an optional view by category.
Create Rule
Clicking on Create Rule takes you to the screen where you can create a new personalisation rule. You enter a name for your rule, select the category you want to place it in, and then choose Conditions > Date from the dropdown.
Next, you can select the comparator, which for this rule type offers the following options:
- Before - Display content before a specific date
- After - Display content after a specific date
- Is - Display content on a specific date
- Days Before - Display content a specified number of days before a target date
- Days After - Display content a specified number of days after a target date
Standard Date Options
For Before, After, and Is comparators, you choose a period of date using the value field - which opens up a date picker.
Days Before/After Options
When you select "Days Before" or "Days After", you'll see additional fields:
- Target Date: Use the date picker to select your reference date
- Number of Days: Enter the number of days before or after the target date when the content should display
For example:
- Days Before: Show a countdown message 7 days before an event date
- Days After: Display follow-up content 3 days after a campaign end date
Common Use Cases
Event Countdown Messaging
Create anticipation for upcoming events:
- Show "5 days until our sale starts!" using "Days Before" with your sale start date
- Display "Early bird pricing ends in 3 days" using "Days Before" with your pricing deadline
Seasonal Campaign Timing
Perfect timing for seasonal content:
- Launch Christmas content exactly 30 days before 25th December using "Days Before"
- Show "Back to school" promotions 14 days before term starts using "Days Before"
Post-Event Follow-up
Engage customers after important dates:
- Display "How did you find our event?" 2 days after using "Days After"
- Show related products 7 days after a product launch using "Days After"
Multiple Date Rules
If you're creating a rule that covers multiple dates or date ranges, you can use the +Add option to add as many conditions as you wish. This is particularly useful when combining different date comparators for complex timing scenarios.
Click on the button to Create Rule and return to the list screen.
Using Date-Based Rules
You can choose a rule in the Personalise sidebar for any block that you can select in the Block Editor.
Rules has its own dropdown, and you can select any of the rules that are active. In this instance, select your chosen date-based rule and then determine the behaviour for that block (show/hide) if the visitor meets that criteria.
If you wish, you can add multiple rules to the same block, even those of a different type and category - for instance, date and location.
You can also combine a personalisation rule with segments and lead score values to create highly targeted content.
Important Notes
- Date calculations are based on the visitor's local timezone
- The "Days Before/After" functionality calculates from the current date to determine if the specified day range is met
- All date-based rules update automatically each day, so no manual intervention is required
- Date rules work for both logged-in and guest users
Troubleshooting
If your date-based rules aren't working as expected:
- Check that your target dates are set correctly in the date picker
- Verify the number of days specified for "Days Before/After" conditions
- Ensure your rule is set to "Active" status
- Test with different dates to confirm the rule triggers at the right times
- Consider timezone differences if your audience spans multiple regions