Comment Translator & Spam Checker
WordPress plugin that translates comments and checks for spam using the Anthropic API
by Dirk Tilger · github.com/miriup/wp-admin-comment-translator
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/miriup/wp-admin-comment-translator/archive/refs/heads/claude%2Fwordpress-comment-translator-plugin-2n9o6.zipA WordPress plugin that adds an inline AI-powered assessment panel to the comment moderation screen. It detects the language of each comment, translates it to English, and classifies it as spam, legit, or unsure — all without leaving the admin interface.
Features
- Language detection — identifies the language of each comment
- English translation — translates non-English comments inline
- Spam assessment — classifies comments as spam, legit, or unsure with a one-sentence explanation
- Inline UI — results appear directly below each comment in the moderation list
- No external dependencies — vanilla JS and inline CSS only
Requirements
- WordPress 5.0 or later
- PHP 7.4 or later
- An Anthropic API key
Installation
- Download
comment-translator.php - Upload it to your
wp-content/plugins/directory - Activate the plugin in Plugins in the WordPress admin
Configuration
- Go to Settings > Comment Translator
- Enter your Anthropic API key
- Click Save Changes
Usage
- Navigate to Comments (wp-admin/edit-comments.php)
- Each comment row now has a Translate & Assess button
- Click the button to send the comment text to the Anthropic API
- The result appears inline with:
- A blue badge showing the detected language
- A colored verdict badge: green (legit), red (spam), or yellow (unsure)
- The English translation of the comment
- A short explanation for the verdict
How It Works
When you click "Translate & Assess", the plugin sends the comment text via a WordPress AJAX call to a PHP handler. The handler calls the Anthropic Messages API using the claude-sonnet-4-20250514 model and returns structured JSON with the language, translation, verdict, and reason. The result is rendered inline using vanilla JavaScript.
All AJAX calls are secured with WordPress nonces and require the moderate_comments capability.
License
GPL-2.0-or-later. See LICENSE for details.