Posts: 3,491
Threads: 106
Joined: Mar 2010
I like the new automatic sitemap generation (though it'd be nice being able to disable it, via gsconfig or setting), but I honestly think that pinging SEs by default is not a good idea. I didn't know about this new feature, and found that one of my 3.1 test sites was quickly indexed by Google.
Not a problem for me, I will just delete my site, but If you are developing a new site for a client or just trying GS, and forget to (or don't know you have to) enable GSDONOTPING, it will probably be involuntarily indexed.
Posts: 1,848
Threads: 86
Joined: Aug 2009
I think I agree with you. before since you actually had to manually generate your sitemap, it was known that you were pinging search engines. now that it's automatic, I am changing gsconfig to turn it off by default.
Thanks Carlos!
- Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 2,928
Threads: 195
Joined: Feb 2011
maybe that could become a setting in the "general settings section" and maybe the names of the search engines could be listed ... in a future version of GS ;=)
Posts: 524
Threads: 48
Joined: Mar 2011
Thanks for the heads up, Carlos and Chris for not activating the auto ping after installation!
Posts: 3,491
Threads: 106
Joined: Mar 2010
Like Connie, I think it would be great to have this in backend settings. Some checkbox(es), like:
Code: [ ] Ping search engines when site updated
or even greater:
Code: [x] Generate sitemap when site updated
[ ] Ping search engines automatically
The second checkbox could be hidden if the first is unchecked.
But anyway this could be left for GS 3.2 (or 3.1.1...)
Posts: 1,848
Threads: 86
Joined: Aug 2009
i agree... lets put that on the roadmap for 3.2
- Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 1,108
Threads: 70
Joined: Aug 2009
Added this to the issue tracker
Posts: 3,491
Threads: 106
Joined: Mar 2010
(Besides what I suggested in post 5 in this thread)
- I'd suggest to be able to disable the sitemap generation with a new gsconfig setting, e.g. GSNOSITEMAP
- Another possibility is stuffing all the sitemap code into a plugin, to be bundled with GS, so if you don't need it you just disable or remove the plugin.
Either of those would also let other plugins -like I18N- generate their own special sitemap, or allow creation of custom sitemap plugins...
Posts: 1,848
Threads: 86
Joined: Aug 2009
i dont see why you don't want the sitemap to be generated? If you dont use it, then dont use it... the generation (once the code is fixed to not recreate it once per file) doesnt take very much overhead.
- Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 3,491
Threads: 106
Joined: Mar 2010
ccagle8 Wrote:i dont see why you don't want the sitemap to be generated? If you dont use it, then dont use it... the generation (once the code is fixed to not recreate it once per file) doesnt take very much overhead.
Sorry, I have to disagree with you. Even with that code fixed (and even making it use internal page caching instead of reading all xml files), it's not only that small overhead, but also doing an unnecessary file write to disk.
But anyway, let's leave this aside for a moment: What about my last paragraph? (custom sitemap plugins, etc.)
Posts: 2,094
Threads: 54
Joined: Jan 2011
I'll add here other things I've noticed with sitemap generation: - the sitemap actions are useless (see here)
- action changedata-aftersave is executed BEFORE generate_sitemap, page-delete AFTER generate_sitemap
- there is no action when restoring backed up pages - it would be needed to generate custom sitemaps.
Posts: 2,094
Threads: 54
Joined: Jan 2011
@Carlos: I18N now generates a sitemap (in most cases), see here.
@ccagle8, n00dles101: it's easy in 3.0 (just change the link of the "Generate Sitemap" menu), but nearly impossible in 3.1: e.g. - for page save I use the changedata-aftersave action, generate the sitemap, do the same as in changedata.php, but without calling generate_sitemap and die.
- for page delete and save settings, I regenerate the sitemap correctly afterwards on an action hook
- for restoring a page there is no hook - I can't generate the correct sitemap in that case.
Posts: 3,491
Threads: 106
Joined: Mar 2010
2012-04-08, 18:06:19
(This post was last modified: 2012-04-12, 17:29:03 by fotothink.)
@ccagle & all
I'd like to add another possibility to those two I suggested in post 8 (this thread):
- Add a hook or filter at the beginning of function generate_sitemap(), that returns without generating the sitemap if some condition is met.
For example:
Code: function generate_sitemap() {
global $nositemap;
$nositemap = FALSE;
exec_action('before-sitemap'); // a plugin could set $nositemap to TRUE here
if ($nositemap) return TRUE;
// ... GS code for generating the sitemap
(Possibly there's a better way to do this...)
(Edit: typo fix)
Posts: 3,491
Threads: 106
Joined: Mar 2010
mvlcek Wrote:for page save I use the changedata-aftersave action, generate the sitemap, do the same as in changedata.php, but without calling generate_sitemap and die. Clever way of patching without changing the core! :-)
But replacing/customizing/removing the sitemap it shouldn't be so complicated...
Posts: 3,491
Threads: 106
Joined: Mar 2010
More or less the same as in post #13, but using a new filter (instead of an action):
Code: function generate_sitemap() {
$nositemap = exec_filter('replace-sitemap',FALSE); // a plugin could return TRUE here
if ($nositemap) return TRUE;
// ... GS code for generating the sitemap
Opinions? Better than a GSNOSITEMAP gsconfig setting as I also suggested?
Posts: 6,266
Threads: 181
Joined: Sep 2011
Carlos Wrote:More or less the same as in post #13, but using a new filter (instead of an action):
Code: function generate_sitemap() {
$nositemap = exec_filter('replace-sitemap',FALSE); // a plugin could return TRUE here
if ($nositemap) return TRUE;
// ... GS code for generating the sitemap
Opinions? Better than a GSNOSITEMAP gsconfig setting as I also suggested?
Instead of all that, maybe just use a global for the sitemap itself (xml or array or object), before creating it, call the hook, if after the hook the global is no longer empty then something already made a sitemap for us so we exit.
Also i think exec_action uses call_user_func which is anonymous and will never get the return value, actually since exec action loops its not possible to even have a return, or else it would break the loop.
Posts: 3,491
Threads: 106
Joined: Mar 2010
shawn_a Wrote:Instead of all that, maybe just use a global for the sitemap itself (xml or array or object), before creating it, call the hook, if after the hook the global is no longer empty then something already made a sitemap for us so we exit.
Yes, that's another possibility. A 'replace-sitemap' hook or filter.
I've sometimes thought about that, I intended to suggest someday a new type of hook/filter, not only for this sitemap thing, but for template tags like get_navigation, get_page_title, get_content, etc. Something like 'replace-navigation', 'replace-content', etc. GS would check if, after being executed, the corresponding global variable has some value, then stop if it has. This way plugins could customize those tags' outputs without needing to change anything in a typical default template (to make all this easier)
Posts: 3,491
Threads: 106
Joined: Mar 2010
Since GS 3.3.0 there is a 'sitemap' filter.
Posts: 1
Threads: 0
Joined: May 2015
Why don't like auto pinging google when new post created?
|