Yes. wordpress Pictures add alt properties and bitle attributes to enhance the site’s presence100 degreesWaiting for the intake in the search engine. For the website. I don’t know. It’s very helpful. If you don’t know about the alt properties and bitle attributes, you can look at this article: the difference between the alt and title properties in the img label, their effects and seo effects. We can upload pictures from behind.DefinitionsProperties such as title, description, alternative text, image description, etc. of the picture, as shown in the figure below:
![]()
But it’s cumbersome and easy to ignore to add these graphic properties manually each time. You want to automatically add alt properties and bitle properties to a wordpress picture by adding the following code:WordPress ThemeThe last of the funcings.php files?> Before:
- /**
- * Automatically add alt properties and bitle attributes to the images of WordPress articles
- */
- function image_alttitle( $imgalttitle ){
- global $post;
- $category = get_the_category();
- $fname=$category[0]->cat_name;
- $btitle = get_bloginfo();
- $imgtitle = $post->post_title;
- $imgUrl = “<img\s[^>*src=(?) (♪) >]*?)\\1[^>]*>”;
- If…(preg_match_all(“/$imgUrl/siU”,$imgalttitle,$match,Preg_SET_ORDER)
- If…( !emptyempty($match) ){
- You know, for… ($i=0; $i < count($match); $i++){
- $tag = $url = $match[$i][0];
- $j=$i+1;
- $judge = ‘/title=/’;
- preg_match($judge,$tag,$match,PREG_OFFSET_CAPTURE);
- If…( count($match) < 1 )
- $altURL ♪ Alt ♪“‘.$imgtitle.” ‘…$flname.’ title=“‘.$imgtitle.’ ‘…$flname.’ ‘;
- $url = rtrim($url,’>’);
- $url .= $altURL.’>’;
- $imgalttitle = str_replace($tag,$url,$imgalttitle);
- }
- }
- }
- return $imgalttitle;
- }
- add_filter( ‘the_content’,’image_alttitle’);
Of these codes:
- $altURL ♪ Alt ♪“‘.$imgtitle.” ‘…$flname.’ title=“‘.$imgtitle.’ ‘…$flname.’ ‘;
Displays the alt properties in the form of ” article title, class name, selected items ” , and the bitle attributes in the form of ” article title, classification name, selected posts.”
Code description:
1 This code automatically determines whether the picture has an alt or tile attribute, and if not, then it automatically adds analt and a bitle property to the image. 2 If the picture already has an att or title attribute, even when the value is empty, it does not add the corresponding alt and bitl properties, such as “alt=” and “title=” for the picture. 3 And now many WordPress themes have the function of automatically adding the alt and tile attributes to the picture, which you can use if your subject does not have this feature. If you don’t like the folding code, you can also use the above codes.WordPress plugins PB SEO Friendly Images, same effect.
Download Address:https://wordpress.org/plugins/pb-seo-friendly-images/
未经允许不得转载:萌萌Apprentissage » Fix the Alt properties of Wordpress Google SEO search engine to optimize missing images
WordPress Summary of Moving Methods: Migration of Hosts and Replacement of Domain Names
How to set auto-optimize auto-autoptimize plugins for your WordPress site
Optimization of seo search for 100 degrees of keywords through the ip proxy pool
WordPress Configure Memcached Cache Course (no code required)
Use the tower panel to accelerate the optimization of the course on Wordpress 4 paces
Wordpress used redis or memcached to make site caches optimized.
Wordpress website moveovers to change domain name solutions
Method to change the default login page name for Wordpress wp-login