XF 2.1 Automatically submit sitemap to search engine

DModified

New member
Hello,

my current setting is on this screenshot below:
Capture.webp

However, I noticed that Google Search Console and Bing Webmaster Tools never received an updated sitemap. So I have to manually enter them at Google Search Console or Bing Webmaster Tools whenever there is changes.

First for Bing, I checked by typing : https://www.bing.com/ping?sitemap={https://ducatimodified.com/sitemap.xml} into my browser,
and it return an error message:
We did not receive your sitemap. Please submit it using the following format: http://www.bing.com/ping?sitemap=[your sitemap web address]

Same thing with Google, I type: https://www.google.com/webmasters/tools/ping?sitemap={https://ducatimodified.com/sitemap.xml}
and it return an error message:

Bad Request​

Error 400​


Is this means, the automatic function to submit sitemap to Google and Bing search engines did not work?
What do I need to do to be able to automatically submit sitemap to search engine?

Thank You
 
Get rid of the parentheses {}. The parenthesis are only required to distinguish a variable like {$url}. When using the full url itself just place it in without the parentheses.

If using the url variable links should look this (how it is by default in Xenforo settings):
Code:
 https://www.google.com/webmasters/tools/ping?sitemap={$url}
 https://www.bing.com/ping?sitemap={$url}

If using full url links should look something like this (notice no parentheses around sitemap url):
Code:
 https://www.google.com/webmasters/tools/ping?sitemap=https://www.yourwebsite.com/sitemap.xml
 https://www.bing.com/ping?sitemap=https://www.yourwebsite.com/sitemap.xml
 
Deleted {} in the XML sitemap generation:
1631803120404-png.257380

Still see the errors every day.

1631803845404-png.257382

It seems not the parentheses {} problems.
 
Please kindly check it. Replaced my website with mywebsite.com

GuzzleHttp\Exception\ConnectException: Error submitting sitemap to https://www.google.com/webmasters/tools/ping?sitemap=https://mywebsite.com/sitemap.xml: cURL error 28: Failed to connect to www.google.com port 443: Connection timed out (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:185
Generated by: Unknown account Sep 14, 2021 at 12:01 PM

Stack trace​

#0 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(149): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 src/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(102): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 src/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 src/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#5 src/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(37): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#6 src/vendor/guzzlehttp/guzzle/src/Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#7 src/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#8 src/vendor/guzzlehttp/guzzle/src/Middleware.php(60): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#9 src/vendor/guzzlehttp/guzzle/src/HandlerStack.php(67): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#10 src/vendor/guzzlehttp/guzzle/src/Client.php(277): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#11 src/vendor/guzzlehttp/guzzle/src/Client.php(125): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#12 src/vendor/guzzlehttp/guzzle/src/Client.php(131): GuzzleHttp\Client->requestAsync('get', Object(GuzzleHttp\Psr7\Uri), Array)
#13 src/vendor/guzzlehttp/guzzle/src/Client.php(89): GuzzleHttp\Client->request('get', 'https://www.goo...', Array)
#14 src/XF/Sitemap/Builder.php(506): GuzzleHttp\Client->__call('get', Array)
#15 src/XF/Sitemap/Builder.php(430): XF\Sitemap\Builder->sendPing()
#16 src/XF/Sitemap/Builder.php(71): XF\Sitemap\Builder->completeBuild()
#17 src/XF/Job/Sitemap.php(25): XF\Sitemap\Builder->build(7.3653)
#18 src/XF/Job/Manager.php(258): XF\Job\Sitemap->run(8)
#19 src/XF/Job/Manager.php(200): XF\Job\Manager->runJobInternal(Array, 8)
#20 src/XF/Job/Manager.php(84): XF\Job\Manager->runJobEntry(Array, 8)
#21 job.php(43): XF\Job\Manager->runQueue(false, 8)
#22 {main}


Request state
array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(51) "https://mywebsite.com/resources/categories/vr.1/?page=2"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
It appears you are getting two different errors one that is repeating for Google and another that is repeating for Baidu.

I would contact your host and let them know both of these errors, there are not likely related to XenForo. The Google error is a connection timeout, likely related to a server issue.

I am unfamiliar with Baidu submissions.
 
Thank you for your answer.

I would like to solve the google sitemap submitting error. My server is located in HK, it is quite strange with a connection timeout problem.
 
Get rid of the parentheses {}. The parenthesis are only required to distinguish a variable like {$url}. When using the full url itself just place it in without the parentheses.

If using the url variable links should look this (how it is by default in Xenforo settings):
Code:
 https://www.google.com/webmasters/tools/ping?sitemap={$url}
 https://www.bing.com/ping?sitemap={$url}

If using full url links should look something like this (notice no parentheses around sitemap url):
Code:
 https://www.google.com/webmasters/tools/ping?sitemap=https://www.yourwebsite.com/sitemap.xml
 https://www.bing.com/ping?sitemap=https://www.yourwebsite.com/sitemap.xml

What do you mean by "If using full url links should look something like this (notice no parentheses around sitemap url):"?
 
What do you mean by "If using full url links should look something like this (notice no parentheses around sitemap url):"?

The original poster referenced this in their first post...
Same thing with Google, I type: https://www.google.com/webmasters/tools/ping?sitemap={https://ducatimodified.com/sitemap.xml}
and it return an error message:

Bad Request​

Error 400​


Is this means, the automatic function to submit sitemap to Google and Bing search engines did not work?
What do I need to do to be able to automatically submit sitemap to search engine?

Thank You

I then let them know that using parentheses around full urls was incorrect the correct reference would be:
Code:
https://www.google.com/webmasters/tools/ping?sitemap=https://ducatimodified.com/sitemap.xml

Using parenthesis with full urls will cause the "Bad Request Error 400".
 
The original poster referenced this in their first post...


I then let them know that using parentheses around full urls was incorrect the correct reference would be:
Code:
https://www.google.com/webmasters/tools/ping?sitemap=https://ducatimodified.com/sitemap.xml

Using parenthesis with full urls will cause the "Bad Request Error 400".

Thank you.
 
So do I have to replace the []? and put the sitemap link there or can I just leave the default without links?
The only time you would need to change/remove the existing "{$url}" from the end of the sitemap links is if for some reason you changed the default location or name of the sitemap, which is not very common.
 
Back
Top Bottom