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!

By | 2012-07-04T16:40:48+00:00 July 4th, 2012|Categories: Wordpress|Tags: , |4 Comments

About the Author:

4 Comments

  1. Cogistator July 5, 2012 at 6:50 am - Reply

    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);
    }
    }

    • Brent July 5, 2012 at 8:38 am - Reply

      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.

  2. Zemra February 8, 2014 at 3:00 am - Reply

    I have problem with google, and since this plguin hasent been updated for a long time and on the other side google does changes every day … you cant solve the problem by removing ask from the list.

    • brent February 9, 2014 at 4:45 pm - Reply

      I haven’t used this plugin for quite some time now, but I am fairly confident there is a debug mode you can put it in. Could try enabling that and seeing what kind of error messages it gives you.

Leave A Comment