Añadir atributo alt a múltiples imágenes en una web

  • Autor Autor bulgaro10
  • Fecha de inicio Fecha de inicio
B

bulgaro10

Beta
Verificación en dos pasos activada
Verificado por Whatsapp
Hola tengo más de 250 imágenes en mi web sin atributo alt , hay alguna forma o plugin para hacerlo de forma masiva? gracias de antemano
 
Quizás si introduces este codigo en single.php te podría ayudar:
Insertar CODE, HTML o PHP:
while (have_posts()) : the_post();

    global $post;
    if ( preg_match_all('/<img (.+?)>/', the_content(), $matches) ) {
            foreach ($matches[1] as $match) {
                    foreach ( wp_kses_hair($match, array('http')) as $attr)
                        $img[$attr['name']] = $attr['value'];
                    echo $img['src'];
            }
    }

endwhile;
 
Hay plugins de SEO como Yoast y Rank Math que tienen la opcion de rellenar el alt de cada imagen automaticamente con el titulo de dicha imagen
 
Atrás
Arriba