Skip to main content

Rewind.ai WordPress Plugin

AI tools for WordPress. Content generation, images and more.

Rewind.ai for WordPress

Add AI-powered content generation, image creation, text-to-speech and translation directly to your WordPress site using shortcodes and our REST API.

Custom Shortcode (PHP)

Create a WordPress shortcode that calls the Rewind.ai API. Add this to your theme's functions.php:

<code>function freeai_generate($atts) {
    $atts = shortcode_atts(['prompt' => '', 'model' => 'qwen/qwen-2.5-72b-instruct'], $atts);
    $response = wp_remote_post('https://api.rewind.ai/v1/chat/completions', [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_KEY',
            'Content-Type'  => 'application/json',
        ],
        'body' => json_encode([
            'model'    => $atts['model'],
            'messages' => [['role' => 'user', 'content' => $atts['prompt']]],
        ]),
    ]);
    if (is_wp_error($response)) return 'Error generating content.';
    $body = json_decode(wp_remote_retrieve_body($response), true);
    return '<div class="freeai-output">' .
        esc_html($body['choices'][0]['message']['content'] ?? '') .
        '</div>';
}
add_shortcode('freeai', 'freeai_generate');</code>

Then use it in any post or page:

<code>[freeai prompt="Write a 100-word product description for organic coffee"]</code>

Use Cases for WordPress

  • Auto-generate SEO meta descriptions for posts
  • AI-powered image generation for featured images
  • Translate posts into multiple languages automatically
  • Add text-to-speech audio to articles
  • AI chatbot for visitor support
  • Content summarization for long-form articles

FAQ

Create a custom shortcode that calls the Rewind.ai API from your theme&apos;s functions.php, then use it in any post or page. No plugin required.

No. Rewind.ai works with standard PHP shortcodes. You do not need to install a plugin, a custom shortcode in functions.php is all that is required.

You can add AI chat, text-to-speech, translation, image generation, content summarization, SEO meta description generation, and more. Any Rewind.ai tool accessible via the API can be integrated into WordPress.

Add a PHP function to your theme&apos;s functions.php that calls the Rewind.ai API with wp_remote_post. Register it as a shortcode. Then use [freeai prompt=&apos;your prompt&apos;] in any post or page to generate AI content inline.

No. API calls run only when the shortcode renders or on demand, not on every page load. You can also cache generated content so repeat visits make no API calls at all.

Yes. Use the API shortcode to generate meta descriptions from your post content. Call the API with a prompt like &apos;Write a 155-character SEO meta description for this article: [post content]&apos; and output the result in your theme&apos;s head section.

Yes. Use the Rewind.ai translation API to translate post content into multiple languages. This can be automated with a custom function that translates on publish.

Yes. The PHP shortcode works in any post, page, or block in Elementor, Gutenberg, Divi, or any other page builder that supports WordPress shortcodes.

The integration itself is free. API calls consume tokens from your Rewind.ai account. For sites with moderate traffic, the free daily token limit may be sufficient. Higher-traffic sites should consider a paid plan.

Yes. Use the TTS API to pre-generate audio files for your articles and add a listen button, or generate speech on demand through a shortcode. Visitors can click to hear the article read aloud using AI-generated speech.

Store your API key in wp-config.php as a constant (define(&apos;REWIND_API_KEY&apos;, &apos;your_key&apos;)) and reference it in your shortcode function. Never hardcode API keys directly in theme files that might be committed to version control.

Yes. Call the API with a product title and details to generate compelling product descriptions. This can be automated when new products are added or done in bulk for existing product catalogs.

Love Rewind.ai? Tell your friends!

Rate this page