Support » Plugin: NextGEN Gallery Optimizer » How to create image sitemap for nextgen gallery please anyone tell me

Viewing 15 replies - 1 through 15 (of 29 total)
  • Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi cuteantonyraj,

    You might like to try the WordPress SEO plugin by Yoast…

    http://wordpress.org/extend/plugins/wordpress-seo/

    XML Sitemaps
    WordPress SEO has the most advanced XML Sitemaps functionality in any WordPress plugin. Once you check the box, it automatically creates XML sitemaps and notifies Google & Bing of the sitemaps existence. These XML sitemaps include the images in your posts & pages too, so that your images may be found better in the search engines too.

    To quote the NextGEN Gallery extensions page:

    WordPress SEO. This plugin will include NextGEN Gallery images in your XML Sitemaps so they are indexed by search engines.

    Hope this helps!

    Cheers,
    Mark.

    cuteantonyraj

    (@cuteantonyraj)

    Yes Thanks For Ur Info , How To View My Image Sitemap In WordPress SEO , Tell Me The Procedure How To Include Nextgen Gallery In WordPress SEO , Please Help Me

    Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi cuteantonyraj,

    I’ve been looking into this for you, and there appears to be some issues between the two plugins at the moment. Don’t worry, you’re not alone!

    However, I have managed to get NextGEN Gallery’s images listed in WordPress SEO’s sitemaps by editing NextGEN’s sitemap file at wp-content/plugins/nextgen-gallery/lib/sitemap.php (thanks to this and this).

    If you navigate to Plugins –> Editor –> NextGEN Gallery –> “nextgen-gallery/lib/sitemap.php” and replace all the code with the following, you should be all up and running…

    <?php
    /**
    * Main PHP Class for XML Image Sitemaps
    *
    * @author 		Alex Rabe
    * @version      1.0
    * @copyright 	Copyright 2011
    *
    */
    class nggSitemaps {
    
        var $images	= false;
    
        /**
         * nggSitemaps::__construct()
         *
         * @return
         */
        function __construct() {
    
            add_filter('wpseo_sitemap_urlimages', array( &$this, 'add_wpseo_xml_sitemap_images'), 10, 2);
    
        }
    
        /**
         * Filter support for WordPress SEO by Yoast 0.4.0 or higher ( http://wordpress.org/extend/plugins/wordpress-seo/ )
         *
         * @since Version 1.8.0
         * @param array $images
         * @param int $post ID
         * @return array $image list of all founded images
         */
        function add_wpseo_xml_sitemap_images( $images, $post_id )  {
    
            $this->images = $images;
    
            // first get the content of the post/page
            $p = get_post($post_id);
    
            // Backward check for older images
            $p->post_content = NextGEN_Shortcodes::convert_shortcode($p->post_content);
    
            // Don't process the images in the normal way
      		remove_all_shortcodes();
    
            // We cannot parse at this point a album, just galleries & single images
            add_shortcode( 'singlepic', array(&$this, 'add_images' ) );
            add_shortcode( 'thumb', array(&$this, 'add_images' ) );
            add_shortcode( 'nggallery', array(&$this, 'add_gallery') );
            add_shortcode( 'imagebrowser', array(&$this, 'add_gallery' ) );
            add_shortcode( 'slideshow', array(&$this, 'add_gallery' ) );
    
            // Search now for shortcodes
            do_shortcode( $p->post_content );
    
            return $this->images;
        }
    
        /**
         * Parse the gallery/imagebrowser/slideshow shortcode and return all images into an array
         *
         * @param string $atts
         * @return
         */
        function add_gallery( $atts ) {
    
            global $wpdb;
    
            extract(shortcode_atts(array(
                'id'        => 0
            ), $atts ));
    
            // backward compat for user which uses the name instead, still deprecated
            if( !is_numeric($id) )
                $id = $wpdb->get_var( $wpdb->prepare ("SELECT gid FROM $wpdb->nggallery WHERE name = '%s' ", $id) );
    
            $images = nggdb::get_gallery($id, 'pid', 'ASC', true, 1000);
    
            foreach ($images as $image) {
                $src   = $image->imageURL;
                $newimage = array();
                if ( !empty($image->title) )
                    $newimage['title'] = $image->title;
                if ( !empty($image->alttext) )
                    $newimage['alt']   = $image->alttext;
                $newimage['src'] = $image->imageURL;
                $this->images[$src] = $newimage;
            }
    
            return;
        }
    }
    $nggSitemaps = new nggSitemaps();

    Note 1: You may need to click the “Save Settings” button at SEO –> XML Sitemaps afterwards in order to re-build your sitemaps, and also clear out any caching plugins you have installed to see them update.

    Note 2: What you’re looking for in your sitemaps are the image counts when you click-through to /post-sitemap.xml and /page-sitemap.xml from http://www.yoursite.com/sitemap_index.xml. The totals should now include your images from NextGEN. Also, if you look at the post/page sitemap’s source code in your browser (often View –> View Source), you’ll now see the full URLs for all of your images nested below each post listing.

    I hope this helps!

    Cheers,
    Mark.

    cuteantonyraj

    (@cuteantonyraj)

    Its Not Working Giving Error Message

    Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi cuteantonyraj,

    I’ve just tested the above code again on the latest plugin versions to be sure we’re on the same page…

    WordPress v3.5.1
    NextGEN Gallery v1.9.12
    WordPress SEO v1.4.1

    Everything appears to be working well, however you may need to have “Picture tag (ngg_tag)” selected at SEO –> XML Sitemaps in order for your sitemap to display initially (I was getting a Not Found error for a while there).

    Hope this helps!

    Cheers,
    Mark.

    cuteantonyraj

    (@cuteantonyraj)

    Hi Mark jeldi,

    Thanks My New Plugin Updated helped me
    i Can able to see my image sitemap in post-sitemap.xml by viewing page source , i have one doubt can we create sitemap for nextgen gallery attachment page , in google im seeing other websites nextgen gallery image attachment pages are indexed , how to do that , In My post-Sitemap.xml The Image url locating post url , not locating nextgen gallery attachment page

    for example

    <loc>http://www.cinepluz.com/gallery/actress-charmi-kaur-latest-hot-and-sexy-latest-photoshoot/</loc>
    		<lastmod>2013-03-05T08:28:12+00:00</lastmod>
    		<changefreq>weekly</changefreq>
    		<priority>0.6</priority>
    		<image:image>
    			<image:loc>http://www.cinepluz.com/wp-content/uploads/2013/02/charmi-latest-hot-and-sexy-images-in-the-black-dress-photshoot-5.jpg</image:loc>
    			<image:caption>charmi latest hot and sexy images in the black dress photshoot (5)</image:caption>
    		</image:image>

    in this sitemap file my nextgen gallery image url not targetting nextgen gallery attachment page url

    http://www.cinepluz.com/gallery/actress-charmi-kaur-latest-hot-and-sexy-latest-photoshoot/?pid=1

    Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi cuteantonyraj,

    That’s great to hear!

    I’ve just had a look at your site, and it looks like you’re using the “Show ImageBrowser” option at Gallery –> Options –> Gallery, which causes the page to refresh (with a query string parameter appended to the URL) when a thumbnail is clicked.

    I’m not sure if it’s possible for WordPress SEO to detect these pseudo-pages, as they’re created on-the-fly with PHP (rather than being pulled from the database)…but you may not really need them to be included at all.

    You’ve mentioned you’ve seen other sites with these pages indexed by Google, but are you sure these pages were included in their sitemaps? You don’t need a sitemap at all to get indexed. They simply help the bots find more of your content more quickly.

    Alternatively, you might like to enquire about this further, or submit a feature request at the WordPress SEO Support Forum or the NextGEN Gallery Support Forum.

    Hope this helps!

    Cheers,
    Mark.

    cuteantonyraj

    (@cuteantonyraj)

    Hi Mark Jeldi
    Thanks For Helping Me

    Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi cuteantonyraj,

    No worries. I’m glad I could help 🙂

    I’ve been thinking…you might not actually want your single-image imagebrowser pages indexed, since they don’t have any other unique content on them. Without any text, they probably won’t rank for anything anyway, and they may even drag down the rest of your site under the thin content penalty. Just a thought.

    All the best with your site!

    Cheers,
    Mark.

    Hi Mark Jeldi,

    we are using the plugin for some 2 years for all the Galleries on My website but the Only negative point i see is the images are not indexing in GOOGle Image Search …is there any solution to solve the problem ….even after Following the Above instruction i did get the solution for the problem …we are using sitemap using Yoast SEO Plugin….is there any solution to make some changes…For referance you can look this Url http://www.tollywoodandhra.in/

    [ Signature moderated. ]

    Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi tollywoodandhra,

    I’ve just taken a look at your site, and it appears everything’s working correctly. If you look at the source code of the following URL (often View –> View Source in your browser), you’ll see all the individual images listed for each post…

    http://www.tollywoodandhra.in/post-sitemap13.xml

    It may also take Google a while to detect and index your sitemap (though you could try adding it in Webmaster Tools to speed up the process). If they don’t come up soon, you may also have some sort of conflict with another sitemap plugin you’re using called “Sitemap Generator Plugin for WordPress”. You can see its output at the following address…

    http://www.tollywoodandhra.in/sitemap/

    Hope this helps!

    Cheers,
    Mark.

    Hi Mark,

    Thanks for the reply ..I have removed the plugin “Sitemap Generator Plugin for WordPress” still i dont see the images are listing in Google Images…
    Can you suggest some solution for this

    –TollywoodAndhra

    Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi tollywoodandhra,

    Your images do appear to be indexed on my end…

    To test, go to this sitemap page:
    http://www.tollywoodandhra.in/post-sitemap13.xml

    The first image url listed in the source code of that page is as follows:
    http://www.tollywoodandhra.in/wp-content/gallery/adda-stills/adda-movie-stills-1.jpg

    If you google that image link under Google Image Search, it’s the first result 🙂

    Hope this helps!

    Cheers,
    Mark.

    Hi

    Just tried and i dont see the images are indexed from our url…

    you can check with this url and i also see that sitemap is adding images but its not indexing in google …

    Approx we have around 40,000 images in which 1700 are indexed

    https://www.google.co.in/search?hl=en&biw=1379&bih=880&site=imghp&tbm=isch&q=adda+movie&oq=&gs_l=#hl=en&site=imghp&tbm=isch&sa=1&q=http:%2F%2Fwww.tollywoodandhra.in%2Fwp-content%2Fgallery%2Fadda-stills%2Fadda-movie-stills-1.jpg&oq=http:%2F%2Fwww.tollywoodandhra.in%2Fwp-content%2Fgallery%2Fadda-stills%2Fadda-movie-stills-1.jpg&gs_l=img.12...27036.27036.6.27817.1.1.0.0.0.0.0.0..0.0...0.0...1c.1.11.img.XRhQZeLCyKY&bav=on.2,or.r_cp.r_qf.&bvm=bv.45921128,d.bmk&fp=e80a99ec1c79d4ce&biw=1379&bih=880

    Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi tollywoodandhra,

    If you search your domain using Google Image Search, it returns “about 69,900 results”.

    Just use the following query…

    site:http://www.tollywoodandhra.in/

    Cheers,
    Mark.

Viewing 15 replies - 1 through 15 (of 29 total)
  • The topic ‘How to create image sitemap for nextgen gallery please anyone tell me’ is closed to new replies.