If you own a Discord server and a WordPress website, you should probably check out my plugin WordPress Discord Post.

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.

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.

1 reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply