This plugin is an integration between your WordPress website and your Discord server, sending to the second one messages when a new post is published, or a contact form is submitted, or even when a new WooCommerce order is received!
Many people though asked me how to send to Discord only posts from specific categories. Here you can find a snippet for this.
Before implementing any code changes, always ensure your site is backed up. This will help you restore things in case of unforeseen errors. I recommend using Jetpack Backup for real-time backups and one-click restores.
Open your functions.php file in wp-content/themes/your-child-theme-name/ and add this code at the end of the file:
This snippet will send only posts from a single category to Discord. In this example the category name is Your Category Name but of course you should change it to something real.
Sending posts to Discord from multiple categories
What if yo want to send posts from multiple categories instead? The code is similar, but you must use an array of categories instead of a simple string:
Replace Category 1 and Category 2 with the names of the categories that you want to send to Discord. You can also add more than two categories in the list.