Meta keywords
-
Hi jacob,
Something seems my wrong in the meta on my site , nether albums or pictures are detected and all the featured photo appear on the meta keywords.
For now, I’ve reduced the number of featured photos, but it’s not very practical.The page I need help with: [log in to see the link]
-
Please give me an examplke of meta keywords that exist, and a link to the place where the search box is
Auto generated keywords : content=”foulque, ecrevisse, length, rating, program, priorite, desactive”
Search https://objectif-image-pau.fr/?s=
Images are successfully transferred to the media library
The problem is that all the featured images each generate a line of meta keywords,
and SEOs like Bing don’t like it when there are too many.So this is the problem: Too many items in:
<!-- WPPA+ BEGIN Featured photos on this site --> <meta name="keywords" content="serapia, lespielle, length, rating, program, priorite, ponderee, desactive"> <meta name="keywords" content="orchidee, becasse, lespielle, length, rating, program, priorite, ponderee, desactive"> <meta name="keywords" content="becassine, length, rating, program, priorite, desactive"> <meta name="keywords" content="passage, length, rating, program, priorite, desactive"> <meta name="keywords" content="foulque, ecrevisse, length, rating, program, priorite, desactive"> <!-- WPPA+ END Featured photos on this site -->Would it be helpfull if i combine them into one <mata> tag with no duplicates?
This is a great idea, it will help me a lot
and allow me to feature more photos on the site.Is it a good idea for me ? to do like this ?
// change les metakeys de wppa function oim_wppa_add_metatags(){ global $post; global $wpdb ; $shortcodes = extraire_shortcodes_et_attributs($post->post_content); foreach ($shortcodes as $shortcode ){ if ( isset( $shortcode['attributs']['album'] )){ $albums_used = wppa_expand_enum( $shortcode['attributs']['album'] ); } if ( isset( $shortcode['attributs']['photo'] )){ $photo_used = wppa_expand_enum( $shortcode['attributs']['photo'] ); } if ( $shortcode['shortcode']=='photo' ){ $photo_used = wppa_expand_enum( $shortcode['attributs'][0] ); } if (isset($albums_used)) { $done = array(); $albums = explode ('.',$albums_used) ; foreach($albums as $album){ if ( wppa_switch( 'meta_page' ) ) { $query = $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos WHERE album = %s AND status = 'featured'", $album ); $photos = wppa_get_results( $query ); wppa_cache_photo( 'add', $photos ); if ( $photos ) { wppa_echo( "\n<!--oim WPPA+ BEGIN Featured photos on albums on this page -->" ); foreach ( $photos as $photo ) { $id = $photo['id']; $content = esc_attr( sanitize_text_field( wppa_get_keywords( $id ) ) ); //$content = esc_attr( sanitize_text_field( oim_get_metawords( $id ) ) ); if ( $content && ! in_array( $content, $done ) ) { wppa_echo( ' <meta name="keywords" content="' . $content . '">' ); $done[] = $content; } } wppa_echo( "\n<!--oim WPPA+ END Featured photos on albums on this page -->\n" ); } } } } if (isset($photo_used)) { $done = array(); $photo = wppa_cache_photo( $photo_used ); if ( $photo['status']=='featured' ) { wppa_echo( "\n<!--oim WPPA+ BEGIN Featured photos on this page -->" ); $content = esc_attr( sanitize_text_field( wppa_get_keywords( $photo_used ) ) ); if ( $content && ! in_array( $content, $done ) ) { wppa_echo( ' <meta name="keywords" content="' . $content . '">' ); $done[] = $content; } wppa_echo( "\n<!--oim WPPA+ END Featured photos on this page -->\n" ); } } } remove_action ('wp_head', 'wppa_add_metatags', 5); } add_action('wp_head', 'oim_wppa_add_metatags', 4); function extraire_shortcodes_et_attributs($contenu) { // Rechercher tous les shortcodes dans le contenu preg_match_all('/\[(\w+)([^\]]*)\]/', $contenu, $matches, PREG_SET_ORDER); $resultats = []; foreach ($matches as $match) { if ($match[1] == 'wppa' || $match[1] == 'photo'){ $attributs = shortcode_parse_atts($match[2]); // Attributs du shortcode $resultats[] = [ 'shortcode' => $match[1], 'attributs' => $attributs, ]; } } return $resultats; }Do not bother, i am working on much simpler and better solution. Will be in the next release, within a few days.
ok many thanks
Please test https://downloads.wp.xz.cn/plugin/wp-photo-album-plus.9.0.08.006.zip
It is not really simpler than your suggestion, but i used a part of your code: thanx for that!
It even supportsalbum="$albumname"and adds subalbums when they are reacheable (by ajax calls)found 2 typo on case”wppa short_code”
L185: $photo_used = ”;//typo: $photos_used = ”;
L215: if ( $photo_used ) $the_photo .= ‘.’.$photo_used;//typo: if ( $photos_used ) $the_photo .= ‘.’.$photos_used;The share menu didn’t appear in the advanced settings, so I didn’t have access to the meta settings to set wppa_meta_all to no.
I don’t see where to set wppa_share_on.All is working fine !! many thankx
Thanx! I am planning to add a possibility to give an extra line of terms to be voided
Strange that you can not open the share tab.
To disable meta all:
Install developers tool plugin https://downloads.wp.xz.cn/plugin/tweak-option.1.8.zip
Find tweak option in the wp tools menuAdd new option
wppa_meta_alland set the value tonoTo see the share tab on advanced settings
I need to tick on slideshow basics settings show share box 1-10
Is not so intuitiveRight, i will remove that
New test version: https://downloads.wp.xz.cn/plugin/wp-photo-album-plus.9.0.08.007.zip
Full changelog:
= 9.0.08 = * Cosmetic changes for certain site configurations by adding css styles that look redundant but can be required though. * Fixed possible glance of white rectangle in lightbox zoomable during image load. * Added .htaccess files in the img subdir where the navigation and cursor icons are and in the wppa-source dir to enable the use of source image files when the site configuration denied http access in those dirs. * Thumbnail popups did not work when there is a single quote in the name or description. Fixed. * New link option: To the entire album on lightbox from the subalbums on the cover. See Settings -> Links -> V -> Item 12 * Fixed helptext for Advanced settings -> System -> Item 5: Frontend ajax method. * Fixed links and titles on album covers. * When filmstrips are generally off in the slideshow settings and the shortcode type is slideonlyf the filmstrip did not show up. This is not logical when it is specifically requested and has been fixed. * Improved algorithm to find keywords of featured items in the page header <meta> tag. * Creating subalbums on the Albums page did not work properly. Fixed. * New setting: Void meta keywords, to add custom words to be excluded from meta keywords. Advanced settings -> Share -> II -> Item 3, originbal items 3 and 4 are renummbered to 4 and 5 * Setting tab Share now also appears when no share buttons used on slideshow or lightbox.On my side everythings work fine
thankx !!
The topic ‘Meta keywords’ is closed to new replies.