Google XML Sitemaps WordPress Plugin – There was a problem writing your sitemap file. Make sure the file exists and is writable. – Solved

Google XML Sitemaps WordPress Plugin – There was a problem writing your sitemap file. Make sure the file exists and is writable. – Solved

I use http://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/ for generating my XML sitemaps for search engines. This is an older plugin but is still in use by many. For quite some time I have been getting an error

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

This error has been bugging me, and I figured it was a permissions issue, but that was not the case. I finally decided to debug and noticed that the plugin was having an issue while submitting my sitemap to Ask.com. Well, it turns out that Ask.com no longer asks for sitemap submissions http://www.ask.com/answers/264341/how-to-submit-sitemap-to-ask-com-when-can-i-get-a-confirmation-that-my-sitemap-is-being-accepted-by-ask-com and this explained my error.

So to solve this issue, navigate to your plugin directory at “wp-content/plugins/google-sitemap-generator/” and edit sitemap-core.php.

Simply remove this chunk of code:

 //Ping Ask.com
        if($this->GetOption("b_pingask") && !empty($pingUrl)) {
            $sPingUrl="http://submissions.ask.com/ping?sitemap=" . urlencode($pingUrl);
            $status->StartAskPing($sPingUrl);
            $pingres=$this->RemoteOpen($sPingUrl);

            if($pingres==NULL || $pingres===false || strpos($pingres,"successfully received and added")===false) { //Ask.com returns 200 OK even if there was an error, so we need to check the content.
                $status->EndAskPing(false,$this->_lastError);
                trigger_error("Failed to ping Ask.com: " . htmlspecialchars(strip_tags($pingres)),E_USER_NOTICE);
            } else {
                $status->EndAskPing(true);
            }
        }

Now the plugin will no longer contact Ask.com and hopefully everything will build for you without having to build manually!

Enjoy!

There are 2 comments .

Cogistator

Hi. I have never written a line of code in my life, BUT followed instructions and deleted the code below. And STILL get the same error. Previously, I also changed the index.php permissions to 777 (under the root folder). So I have learnt alot about things I had no clue about, but dont seem to have solved my problem :( This is what I deleted: //Ping Ask.com
if($this->GetOption(“b_pingask”) && !empty($pingUrl)) {
$sPingUrl=”http://submissions.ask.com/ping?sitemap=” . urlencode($pingUrl);
$status->StartAskPing($sPingUrl);
$pingres=$this->RemoteOpen($sPingUrl);

if($pingres==NULL || $pingres===false || strpos($pingres,”successfully received and added”)===false) { //Ask.com returns 200 OK even if there was an error, so we need to check the content.
$status->EndAskPing(false,$this->_lastError);
trigger_error(“Failed to ping Ask.com: ” . htmlspecialchars(strip_tags($pingres)),E_USER_NOTICE);
} else {
$status->EndAskPing(true);
}
}

Reply »
    Brent

    Hi Cogistator,

    If you go into settings > XML-Sitemap, look for “If you encounter any problems with the build process you can use the

      debug function

    to get more information.” Try debugging this, it will spit out a long debug text message, and take a look to see if that tells you anything more, look for the word “error” anywhere, or you could try pasting it here, and I can try to help you out further.

    Hopefully we can get you up and running with this plugin, it’s very handy.

    Reply »

Share Your Thoughts!

Testimonials

What My Clients Say

Karin - Hope and Future
Brent has always been very prompt and generally exceeds our expectations with his work. His maintenance fee is very reasonable. I strongly recommend him!  We get many compliments on our beautiful web site!
Dan
I contacted Krueger Web Design and Brent did everything.  He setup a test site with the changes so we could verify everything was correct before we transferred from my old hosting provider.  During the setup and conversion Brent was extremely professional and responsive. He responded to any issues the same day.
Dan Kaufman

Contact Krueger Web Design

Have a question for me? Need an estimate? Anything else you might want to talk about? Drop me a line below:

Copyright © 2013 Krueger Web Design - All rights reserved