When it comes to growing your community, you not only need fresh content regularly but also need to engage your loyal readers through comments and other activities. You may not have the time to respond to every comment yourself though. The good news is you can write a simple block of code to reply to certain comments automatically. For example, you can write a function that checks if someone is asking for the price of your product to provide them with the relevant link.

All you need to do is update the keyword array to add custom replies. For example, you can add a discount message for your shop. When someone comments with specific keywords, this function activates to automatically reply to them.
Wordpress Tips
WordPress Function: Auto-Reply to Comments Based on Keywords
By
Wordpress Jedi
When it comes to growing your community, you not only need fresh content regularly but also need to engage your loyal readers through comments and other activities. You may not have the time to respond to every comment yourself though. The good news is you can write a simple block of code to reply to certain comments automatically. For example, you can write a function that checks if someone is asking for the price of your product to provide them with the relevant link.
All you need to do is update the keyword array to add custom replies. For example, you can add a discount message for your shop. When someone comments with specific keywords, this function activates to automatically reply to them.
More WP Tips:
More in Wordpress Tips
Wordpress Plugins
RateSwap Pricing Tables WordPress Plugin for Divi
Those of you who sell a service with multiple pricing tiers will want to add pricing...
Wordpress Tips
WordPress Code: Adaptive Reading Time Calculator
Those of you who have downloaded new themes and plugins have probably noticed that many of...
Wordpress Tips
How to Find Malicious IPs & Bots Hitting Your Server
Have you ever hand lots of traffic from certain IPs causing immense load on your server?...
Wordpress Tips
How to Add DNS Prefetching for External Domains in WordPress
DNS prefetching shouldn’t need any introduction to those of you who have studied how to make...
Wordpress Tips
WordPress Tip: Dynamic Content Variations Based on User Behavior
In the past few months, we have covered plenty of conditional logic plugins that let you...
Current Visits:
Top WP Plugins
Trending
Wordpress Tips
Seasonal Theme Switcher: Automatically Change WordPress Themes Based on Date
Wordpress Plugins
Dark Visitors for WordPress: Opt Out of AI Training
Wordpress Plugins
6 Must See OpenAI WordPress Plugins
Wordpress Plugins
4 WordPress Plugins for DeepSeek Content Generation & Chatbots
Tags
GDPR