`n
🔌 WordPress Plugin

Discord Tunnel | WordPress Plugin

A powerful WordPress plugin that automatically publishes your posts to Discord channels with rich embeds, server/channel selection, custom messages, and per-post controls.

WP 5.0+
WordPress
PHP 7.4+
Requirements
cURL
Extension

Discord Tunnel – WordPress Plugin

A powerful WordPress plugin that automatically publishes your posts and articles to Discord channels with rich embeds and complete customization options.

Features

  • Automatic Publishing: Automatically post new articles to Discord when published
  • Rich Embeds: Beautiful Discord embeds with title, excerpt, featured image, and author
  • Channel Management: View and select Discord channels directly from WordPress admin
  • Server Selection: Support for multiple Discord servers
  • Custom Messages: Add custom messages alongside embeds
  • Manual Control: Per-post control with meta box in post editor
  • Error Handling: Comprehensive error reporting and retry mechanisms
  • Responsive Design: Beautiful admin interface that works on all devices

Installation

  1. Download or clone this plugin to your WordPress wp-content/plugins/ directory
  2. Activate the plugin through the WordPress admin panel
  3. Navigate to Settings > Discord Tunnel to configure the plugin

Discord Bot Setup

Step 1: Create a Discord Application

  1. Go to https://discord.com/developers/applications
  2. Click "New Application" and give it a name
  3. Navigate to the "Bot" section in the left sidebar
  4. Click "Add Bot" to create a bot user
  5. Copy the bot token (you'll need this for the plugin)

Step 2: Configure Bot Permissions

  • Send Messages – To post messages in channels
  • Embed Links – To create rich embeds
  • Attach Files – To include images
  • Read Message History – To access channel information

Step 3: Invite Bot to Your Server

  1. In the Discord Developer Portal, go to the OAuth2 > URL Generator section
  2. Select the bot scope
  3. Select the required permissions listed above
  4. Copy the generated URL and open it in your browser
  5. Select your Discord server and authorize the bot

Plugin Configuration

Step 1: Enter Bot Token

  1. Go to WordPress Admin > Settings > Discord Tunnel
  2. Enter your Discord bot token in the "Bot Token" field
  3. Click "Test Connection" to verify the token works

Step 2: Select Server and Channel

  1. Click Load Servers to fetch your Discord servers
  2. Select the server where you want to post articles
  3. Click Load Channels to fetch available channels
  4. Select the specific channel for posting

Step 3: Configure Publishing Options

  • Auto-Publish: Enable/disable automatic publishing
  • Embed Style: Choose between rich embeds or simple messages
  • Content Options: Include featured images and excerpts
  • Custom Message: Optional message to include with posts

Step 4: Save Settings

Click "Save Changes" to store your configuration.

Usage

Automatic Publishing

Once configured, the plugin will automatically post new articles to Discord when you publish them in WordPress.

Manual Control

  • Each post and page has a "Discord Publishing" meta box in the editor
  • Enable/disable Discord publishing for individual posts
  • View publishing status (success/error)
  • See error messages if publishing fails

Rich Embeds

  • Title: Post title with link to full article
  • Description: Post excerpt or trimmed content
  • Image: Featured image (if available)
  • Author: Post author name
  • Footer: Your site name
  • Timestamp: Publication date

Troubleshooting

"Connection failed" error

  • Verify your bot token is correct
  • Check that the bot token hasn't been regenerated
  • Ensure your server has internet connectivity

"Failed to load servers" error

  • Make sure your bot has been invited to at least one server
  • Verify the bot has proper permissions
  • Check if the bot token is valid

"Failed to load channels" error

  • Ensure the bot has "View Channels" permission
  • Check that the selected server has text channels
  • Verify the bot hasn't been kicked from the server

Posts not publishing

  • Check that auto-publish is enabled
  • Verify the selected channel still exists
  • Look for error messages in the post editor meta box

Technical Details

Requirements

  • WordPress 5.0+
  • PHP 7.4+
  • cURL extension enabled
  • Internet connectivity for Discord API

API Rate Limits

  • Maximum 50 requests per second
  • Automatic retry with exponential backoff
  • Error handling for rate limit responses

Security

  • Bot tokens are stored securely in WordPress options
  • All API requests use HTTPS
  • Input sanitization and validation
  • Proper nonce verification for AJAX requests

Hooks and Filters

Actions

  • discord_tunnel_before_publish - Fired before publishing to Discord
  • discord_tunnel_after_publish - Fired after publishing to Discord
  • discord_tunnel_publish_failed - Fired when publishing fails

Filters

  • discord_tunnel_embed_data - Modify embed data before sending
  • discord_tunnel_message_content - Modify message content
  • discord_tunnel_should_publish - Control whether a post should be published

Support

For support and updates, please visit the plugin repository or contact the developer.

Need a Custom E-commerce Solution?

Let's discuss how I can help bring your online store vision to life with the same level of expertise and attention to detail demonstrated in the Rima project.