WordPress Integration

Translate your WordPress posts, pages, and custom post types with cultural context preservation

Installation

Method 1: WordPress Plugin (Recommended)

  1. Download the CulturalTranslate plugin from WordPress.org
  2. Go to your WordPress admin dashboard
  3. Navigate to Plugins → Add New → Upload Plugin
  4. Upload the downloaded ZIP file
  5. Click Install Now and then Activate

Method 2: REST API Integration

Add this code to your theme's functions.php:

// Add CulturalTranslate API integration
add_action('rest_api_init', function () {
    register_rest_route('culturaltranslate/v1', '/translate', array(
        'methods' => 'POST',
        'callback' => 'culturaltranslate_translate_post',
        'permission_callback' => function () {
            return current_user_can('edit_posts');
        }
    ));
});

function culturaltranslate_translate_post($request) {
    $post_id = $request['post_id'];
    $target_lang = $request['target_lang'];
    
    $api_key = get_option('culturaltranslate_api_key');
    $api_url = 'https://culturaltranslate.com/api/integrations/wordpress/translate';
    
    $response = wp_remote_post($api_url, array(
        'headers' => array(
            'Authorization' => 'Bearer ' . $api_key,
            'Content-Type' => 'application/json'
        ),
        'body' => json_encode(array(
            'post_id' => $post_id,
            'target_language' => $target_lang,
            'site_url' => get_site_url()
        ))
    ));
    
    return json_decode(wp_remote_retrieve_body($response));
}

Configuration

1. Get Your API Key

Get your API key from your CulturalTranslate dashboard

2. Connect WordPress Site

In your WordPress admin:

  1. Go to Settings → CulturalTranslate
  2. Enter your API key
  3. Select target languages
  4. Choose post types to translate
  5. Click Save Changes

3. Start Translating

When editing a post or page, you'll see a "Translate" button in the editor. Click it to translate your content!

Features

Posts & Pages

Translate all your posts and pages automatically

Custom Post Types

Support for WooCommerce products and custom types

Auto-Sync

Keep translations in sync when you update content

SEO Friendly

Optimized for multilingual SEO

Download WordPress Plugin

Get the official CulturalTranslate plugin for WordPress