Just set the image alt text when the image is saved. Hook onto the save_post action, check if any of the attached images don’t have alt text, and if not then generate the alt text you want and save it with:
update_post_meta( $attachment_id, '_wp_attachment_image_alt', 'this is the alt text' );
Related Posts:
- How to Display Image Meta underneath EVERY image in EVERY post
- Show all terms of a custom taxonomy?
- How to update custom fields using the wp_insert_post() function?
- How do I change/modify the_post_thumbnail(); html output?
- What’s the best way to use the Featured Image for responsive web design?
- How to Add Custom Fields to Custom Taxonomies in WordPress CLEANLY
- Get meta_id along with meta_key and meta_value
- Creating custom Woocommerce attribute taxonomies from a plugin
- How to paginate a list of custom taxonomy terms?
- How can merge two arrays values in one array and save in database
- Check if user already visited this post today
- Display all meta for a post?
- PHP/Manual use of images? – 2 Questions
- How to display multiple Post meta_key/meta_values by SQL query
- the_post_thumbnail() based on the Post ID
- How to use multiple query with same meta key
- How to update single value in multi dimensional Post Meta?
- WP_Query | Help me create a search term with an ‘OR’ relation?
- Adding Featured Image to Post programatically
- Get used terms by an author as array of strings
- How to upload imagick resource to media in wordpress
- How to add a featured image to a existing post via php?
- How to use SRCSET with get_the_post_thumbnail()?
- How to get the term before the last from a custom taxonomy?
- Why is my get_post_meta always empty
- Compare two meta key values against each other inside the get_posts array?
- How can update custom meta for all posts
- How to create filterable portfolio in WordPress?
- Adding featured image via PHP
- WordPress loop specific thumbnail size
- WP_Query use for a filter with multiple Taxonomies and Terms
- How do I get images (with a thumbnail preview) to show in search results?
- Use ajax to update_post_meta
- fallback image for featured image
- Display Post co-authored in Author Page
- How to get Poster (thumbnail) Image of Video
- Include a specific post to the query_posts and remove it if it is already in the returned list
- WP Insert Post function – Insert Post Thumbnail
- Display All Post Attachments and Assign Class to the Last Image?
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Add attribute / custom attribute to product in woocommerce
- Assign a picture URL to a page via PHP
- How to add custom taxonomy slug in CPT permalink?
- How to scale image with equal width and height without distortion?
- Show Custom Taxonomy Title
- Featured image fallback link to permalink
- conditional statement for custom taxonomy
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- how to increase custom post value by one most efficiently?
- Batch update a post meta field value of each post in Post Type
- How can I show the post thumbnail from the most recent of a certain post type, in widget?
- get_the_terms – only top level
- Change description on specific WooCommerce product status change
- How can I add pagination and how can I change thumbnail size?
- Get Custom URL For Custom Taxonomy
- get_terms orderby numeric
- Use WP_Query in shortcode
- Rename “Portfolio” slug?
- Sum custom field values of particular taxonomy
- Echo URL of large version of Featured Image
- Query all posts of a custom taxonomy term
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Random order of WP_Query results with highest meta value
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- Values inside a custom field to determine which category posts to display
- Get category id for a custom category and display it in a class
- retrieve wordpress post-meta using php not wordpress functions
- Saving category as insert post
- How to show all of aspecific post type that has taxonomy and a specific term
- Postmeta not saving
- If custom field doesn’t exist, or exists and it’s true show title?
- Overwriting a Shortcode
- featured post as div background
- How to display thumbnail if post is assigned one otherwise not
- Pass custom value to custom taxonomy
- Post Thumbnail on Single (if elseif else)
- get_post_meta is always empty when I use wp_mail
- the_post_thumbnail unless video id is added
- get_post_meta no longer working
- Query specific posts per user selections from dropdown menus
- Setting post thumbnail sizes in template file and functions.php
- How to add together (get the sum) a field from all author’s posts
- Metadata on the WP_Post object
- How to display the date under the post title?
- How can i give a download link to the thumbnail or featured image
- add if statement to the featured image
- How to crop featured image in different sizes?
- Remove default Image Sizes
- How do I change the Go To Categories link in the term_updated_messages
- Display terms on product page with shotrcode
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- Query posts by custom taxonomy slug in WP REST API?
- How can I change the URL via add_rewrite_rule()
- Generate and upload screenshot as featured image for user-submitted post
- How do I get a function to work in single.php
- WordPress different custom tag being displayed in on tag list
- Get category name of current post (CPT UI)
- Three different queries on same page
- I want to show image from custom field image on my custom page template
- How do I organize posts based on their taxonomy?