The MU forums have moved to WordPress.org

Google news sitemap (13 posts)

  1. relics71s
    Member
    Posted 14 years ago #

    Hi,

    Is there a Google news sitemap generator for Wordpress MU?
    I found a few but they're not compatible with MU.

    Thanks.

  2. mattloak
    Member
    Posted 14 years ago #

    Anyone?

  3. andrea_r
    Moderator
    Posted 14 years ago #

  4. mattloak
    Member
    Posted 14 years ago #

    Thanks for the response Andrea but the Google NEWS sitemap is different from the standard xml sitemap. As Google puts it:

    "A News Sitemap uses the Sitemap protocol, with additional News-specific tags as defined below..." http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=74288

  5. andrea_r
    Moderator
    Posted 14 years ago #

    So.... adapt the one above?

  6. mattloak
    Member
    Posted 14 years ago #

    Good idea. I already tried that with the one from WPMUdev.org and another one but got confused by all the variables. This one looks a little more simple. I'll give it a shot.

  7. andrea_r
    Moderator
    Posted 14 years ago #

    Well, compare how the google NEWS sitemap is different from the regualr one.

    then compare how the WPMU end of the plugin is different from the single one.

  8. mattloak
    Member
    Posted 14 years ago #

    I have tried this with several different plugins but I am getting lost primarily because my php knowledge is weak and each plugin expresses functions differently so it's not easy to match up. For example one is defining the url like this:

    $xmlOutput.= "\t\t<loc>";
    		$xmlOutput.= get_permalink($row->ID);
    		$xmlOutput.= "</loc>\n";

    Another like this:

    <loc>".apgnsm_escapexml(get_permalink($post->ID))."</loc>

    Another like this:

    <loc><?php echo get_blog_permalink($blog->blog_id, $post->ID); ?></loc>

    I know that this isn't impossible to do but since there are numerous areas I don't understand I end up getting lost in the translation.

  9. mattloak
    Member
    Posted 14 years ago #

    Ok, I think I have found a scalable fix that is within my skill set...

    Installing this plugin as a blog specific plugin: http://wordpress.org/extend/plugins/google-news-sitemap/

    It allows you to choose the directory where the sitemap should be located, so I can specifiy a different directory for each site and it won't overwrite it and the plugin doesn't have to be aware that it's being run on a multi site MU installation.

    My question is this: Is there an SEO disadvantage to my sitemap not being in the root directory? To make the above work I have it just one level deeper than the root.

  10. andrea_r
    Moderator
    Posted 14 years ago #

    As long as google knows where your sitemap is, I can;t imagine why there woudl be any disadvantage to it not being in the root...

  11. takuya
    Member
    Posted 14 years ago #

    Or you can add extra lines on your .htaccess

    http://wp.openup.jp/en/wordpress-mu/google-sitemap-xml-generators-for-wpmu/

    RewriteRule ^sitemap-news.xml wp-content/blogs.php?file=sitemap-news.xml [L]

    then configure to save the xml files under /blogs.dir/ID/files/sitemap-news.xml but googlebot and you can access the sitemap example.com/sitemap-news.xml

    That's what I do for one of my site, and works fine.

  12. kosmo_p
    Member
    Posted 14 years ago #

    I am in the same situation - using WPMU - I got the above solution to work - however the article time is off by four hours

    is there a way to set the time to match actual article time?

    I have sorta narrowed it down to -

    $xml_sitemap_google_news .= "
    <n:publication_date>".str_replace(" ", "T", $post->post_date_gmt)."Z"."</n:publication_date>
    <n:title>".htmlspecialchars($post->post_title)."</n:title>

    in the sitemap

    In Admin/General Setting I have the UTC set to UTC-4 - but the acruall article time in the sitemap does not include the offset.

    Any help would be greatly appreciated

  13. kosmo_p
    Member
    Posted 14 years ago #

    I think I figured something out
    Changed

    $xml_sitemap_google_news .= "
    <n:publication_date>".str_replace(" ", "T", $post->post_date_gmt)."Z"."</n:publication_date>
    <n:title>".htmlspecialchars($post->post_title)."</n:title>

    to

    $xml_sitemap_google_news .= "
    <n:publication_date>".str_replace(" ", "T", $post->post_date)."Z"."</n:publication_date>
    <n:title>".htmlspecialchars($post->post_title)."</n:title>

    waiting to see if it worked

About this Topic

  • Started 14 years ago by relics71s
  • Latest reply from kosmo_p