WordPress: Solutions To Common Google XML Sitemaps Plugin Problems
Oct 2012 31

Ever Been In Such A Situation?

Isn’t it frustrating when you made up your mind to complete a task, only to run into issues which you had no answers to?
Matters can’t get any worse when this supposedly very popular solution doesn’t provide a very decent support.

That’s exactly the kind of scenario I faced when I was attempting to install the Google XML Sitemaps plugin for WordPress By Arne Brachhold.
To be fair to Arne, this is a free plugin he contributed to the community and we shouldn’t expect too much of his personal time to be devoted to this plugin.
The very least I suppose is a FAQ somewhere on the common issues faced.

2 Common Issues; 2 Solutions To Share

Enough whining about the situation, it’s time to do what the article aims to do – help provide solutions to 2 of the most common issues faced by users.

1. Problem creating sitemap file. This issue can be identified by the error message below:

“There was a problem writing your sitemap file. Make sure the file exists and is writable. Learn more
There was a problem writing your zipped sitemap file. Make sure the file exists and is writable. Learn more”

Follow the steps below to solve this issue.

a. Open up your notepad and save the empty document as sitemap.xml.

b. Create a new text file and save it as sitemap.xml.gz.

c. Create a direction on your ftp server and CHMOD both files to 755 or 777.

d. Return to your Google XML Sitemaps plugin settings page and go to “Location of your site map”.
Choose “custom location”.
For your path, please input the absolute path to your sitemap. Not too sure about your absolute path?
If you are on cPanel, login, refer to Stats on the left, under Home Directory, it should usually be ” /Home/[Username]”.

Screenshot of cPanel

This will be part 1 of your absolute path.
For part 2 of your absolute path, log into your FTP server via a FTP client (Filezilla for example), you will find absolute path part 2  at “Remote Site:” (refer to the screenshot below).

Filezilla Screenshot

The path will usually begin with either /www or /public_html and end with sitemap.xml.
The full absolute path should go something like this – /home/[username]/public_html/site-map/sitemap.xml.
For Complete URL to the sitemap file, including name., just point it to where your sitemap is located – http://www.domain.com/site-map/sitemap.xml etc.

e. Manually generate the sitemap and you should by now, cleared issue #1.



2.  Error loading Stylesheet. This issue can be identified by the error message below:

“Error loading stylesheet: An unknown error has occurred (805303f4)”

This solution is not provided by me, but by Rosamund. Do visit Rosamund Wo for her brilliant sharing.

For the lazy ones, Rosamund’s solution requires the editing of  sitemap-core.php, which often this can be found at /wp-content/plugins/google-sitemap-generator/sitemap-core.php

A best practice I adopt prior to actual editing, is to download the file to the local drive and renaming the copy on the FTP server to sitemap-core.old.
After renaming the file, open the copy on your local drive and look for the following code:

function GetDefaultStyle() {
        $p = $this->GetPluginPath();
        if(file_exists($p . "sitemap.xsl")) {
            $url = $this->GetPluginUrl();
            //If called over the admin area using HTTPS, the stylesheet would also be https url, even if the blog frontend is not.
            if(substr(get_bloginfo('url'),0,5) !="https" && substr($url,0,5)=="https") $url="http" . substr($url,5);
            return $url . 'sitemap.xsl';
        }
        return '';
    }

Replace it with

function GetDefaultStyle() {
        $p = $this->GetPluginPath();
        if(file_exists($p . "sitemap.xsl")) {
            return '/wp-content/plugins/google-sitemap-generator/sitemap.xsl';
        }
        return '';
    }

Now manually generate the sitemap and you should be ready to generate your first sitemap!




2 Comments

  1. Jason Gegere says:

    This was a great note to utilize:

    Choose “custom location”…

    Issue resolved.

Leave a Comment