Documentation

Integrations

WordPress Integration

Set up automatic Open Graph image generation for your WordPress site.

4 min read

The Titlize WordPress plugin automatically generates Open Graph images for your posts and pages. When you publish content, the plugin creates a beautiful social preview image using your post title and featured image.

Installation#

From WordPress Admin#

  1. Go to Plugins > Add New in your WordPress admin
  2. Search for "Titlize"
  3. Click Install Now, then Activate

Manual Installation#

  1. Download the plugin from titlize.com/wordpress (opens in new tab)
  2. Upload to /wp-content/plugins/image-titler/
  3. Activate the plugin through the Plugins menu

Configuration#

Connect Your Account#

  1. Go to Settings > Titlize in WordPress admin
  2. Enter your API token from the Titlize dashboard (opens in new tab)
  3. Click Save Settings

Default Settings#

Configure default behavior for all posts:

SettingDescriptionDefault
Auto-generateGenerate OG images automatically on publishEnabled
Use featured imageUse post's featured image as backgroundEnabled
Default positionText position on imageBottom
Include subtitleUse excerpt as subtitleDisabled
Layout TemplateLayout preset (Bottom Left, Left Side, Right Side, Split)Bottom Left
Gradient OverlayApply tone-adaptive gradient for readabilityEnabled
Text ShadowApply subtle text shadow for readabilityEnabled
Font SizeManual font size override (24–120), empty for autoAuto

Usage#

Automatic Generation#

Once configured, the plugin automatically generates OG images when you:

  • Publish a new post or page
  • Update a post's title or featured image
  • Manually trigger regeneration

Manual Generation#

To manually generate or regenerate an OG image:

  1. Edit the post or page
  2. Find the Titlize meta box in the sidebar
  3. Click Generate OG Image
  4. Preview and save

Post-Level Overrides#

Override default settings for individual posts:

PHP
1// In your theme's functions.php
2add_filter('image_titler_post_settings', function($settings, $post) {
3 if ($post->post_type === 'product') {
4 $settings['position'] = 'bottom-left';
5 $settings['subtitle'] = get_field('product_tagline', $post->ID);
6 }
7 return $settings;
8}, 10, 2);

Hooks and Filters#

Customize Generated Images#

PHP
1// Modify title before generation
2add_filter('image_titler_title', function($title, $post) {
3 return strtoupper($title);
4}, 10, 2);
5
6// Modify the background image
7add_filter('image_titler_background', function($image_url, $post) {
8 // Use a custom image for specific categories
9 if (has_category('featured', $post)) {
10 return get_template_directory_uri() . '/images/featured-bg.jpg';
11 }
12 return $image_url;
13}, 10, 2);

After Generation#

PHP
1// Run custom code after image generation
2add_action('image_titler_generated', function($image_url, $post) {
3 // Clear any caches
4 wp_cache_delete('og_image_' . $post->ID);
5
6 // Log generation
7 error_log("Generated OG image for post {$post->ID}: {$image_url}");
8}, 10, 2);

Shortcodes#

Display the generated OG image in your content:

Plain Text
[image_titler_preview]

With custom attributes:

Plain Text
[image_titler_preview width="600" class="og-preview"]

REST API Endpoint#

The plugin adds a REST endpoint for headless WordPress setups:

Bash
GET /wp-json/image-titler/v1/generate/{post_id}

Response:

JSON
1{
2 "success": true,
3 "image_url": "https://storage.titlize.com/images/gen_abc123.png",
4 "width": 1200,
5 "height": 630
6}

Troubleshooting#

Images Not Generating#

  1. Check API connection - Go to Settings > Titlize and verify "Connected" status
  2. Verify token - Ensure your API token is valid and not expired
  3. Check quota - Verify you haven't exceeded your monthly limit
  4. Debug logs - Enable WP_DEBUG and check wp-content/debug.log

Wrong Image Displaying#

Social platforms cache OG images aggressively. Use these tools to refresh:

Performance Optimization#

Images are generated asynchronously to avoid slowing down post saves:

PHP
1// Disable async processing (not recommended)
2add_filter('image_titler_async', '__return_false');
3
4// Increase async timeout
5add_filter('image_titler_timeout', function() {
6 return 60; // seconds
7});

Uninstallation#

The plugin does not delete generated images when uninstalled. To clean up:

  1. Go to Tools > Titlize > Cleanup
  2. Select cleanup options
  3. Click Remove All Data
  4. Deactivate and delete the plugin

Support#

Next Steps#