AI Image SEO

Filters Reference

schedule 1 min read update Updated 3 days ago local_offer Version 1.0.0

Available Filter Hooks

Filter Examples

functions.php php
/**n * Add brand name to all generated alt textn */nadd_filter('ai_image_seo_generated_alt', function($alt_text, $attachment_id) {n    return $alt_text . ' | MyBrand';n}, 10, 2);nn/**n * Force lowercase filenamesn */nadd_filter('ai_image_seo_filename_suggestion', function($filename) {n    return strtolower($filename);n});nn/**n * Customize SEO score weightsn */nadd_filter('ai_image_seo_score_weights', function($weights) {n    return array(n        'alt_text' => 50,    // Increase alt text importancen        'title'    => 20,n        'filename' => 20,n        'caption'  => 10,n    );n});nn/**n * Enable for custom post typesn */nadd_filter('ai_image_seo_supported_post_types', function($post_types) {n    $post_types[] = 'product';  // WooCommerce productsn    $post_types[] = 'portfolio';n    return $post_types;n});