Extension talk:AutoSitemap

Jump to navigation Jump to search

About this board

Fokebox (talkcontribs)

Hello dear developers, I have found some bugs of the extension, to be correct - there are two other extension that incompatible with following extension that do not function correctly:

  • MSUpload - Multiple upload of the files
  • Flow - Creates topics at Discussion pages

So when I upload files the extension shows some error addressing to autositemap extension. Topic doesn't appear immediately (ass it should be) when I add it at discussion page with Flow. It appears just after refreshing the page. As I switch off the Autositemap extension all works fine. Would be nice if you fix this problem!

I imported 150K articles and the extension blocked editing

Uziel302 (talkcontribs)

"Notice: Only variables should be assigned by reference in /var/www/html/meaning.wiki/public_html/h/extensions/AutoSitemap/AutoSitemap_body.php on line 118

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 50874710 bytes) in /var/www/html/meaning.wiki/public_html/h/extensions/AutoSitemap/AutoSitemap_body.php on line 108"

Martynov Maxim (talkcontribs)

It looks like you didn't set enough memory to php interpreter, so generated sitemap file size exceeds memory limit. Try to set higher memory limit for php or set filters for namespace or pages to reduce sitemap size.

Uziel302 (talkcontribs)

How do I change limit? How do I reduce sitemap without deleting articles?

Martynov Maxim (talkcontribs)


You can add some page names to $wgAutoSitemap["exclude_pages"] or namespaces to $wgAutoSitemap["exclude_namespaces"] and they be excluded from sitemap.

Uziel302 (talkcontribs)

I know how to google, I changed multiple memory limits in php.ini and I thought there is something specific for this one. Is the php interpreter limit you talked about lives in the php.ini?

Uziel302 (talkcontribs)

In the list of namespace available to exclude I didn't find main namespace where all my articles are. I won't list 150K pages.

Uziel302 (talkcontribs)

I installed this extension on a private wiki and got: "Error, edit not saved" when trying to save from mobile view (MinervaNeue). Edit was actually saved. Desktop works fine.

I noted out the line on localsettings and it fixed the issue. Probably gonna play with it back and forth when I want new sitemap.

Martynov Maxim (talkcontribs)

Can you provide error log?

Uziel302 (talkcontribs)

Apache/2.4.29 (Ubuntu) configured -- resuming normal operations [Tue Jul 09 19:09:16.600629 2019] [core:notice] [pid 6899] AH00094: Command line: '/usr/sbin/apache2' [Tue Jul 09 19:10:21.934343 2019] [php7:notice] [pid 6917] [client] PHP Notice: Only variables should be assigned by reference in /var/www/html/meaning.wiki/public_html/h/extensions/AutoSitemap/AutoSitemap_body.php on line 118, referer: http://meaning.wiki/en/Crocheting [Tue Jul 09 19:11:20.854122 2019] [php7:error] [pid 6917] [client] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 50980320 bytes) in /var/www/html/meaning.wiki/public_html/h/extensions/AutoSitemap/AutoSitemap_body.php on line 108, referer: http://meaning.wiki/en/Crocheting

Martynov Maxim (talkcontribs)

Same error as above, I guess.

Uziel302 (talkcontribs)

The issue on mobile happened even before the import when no limit could have been met. I won't remove the import for original error log. Maybe if I could exclude main namespace temporarily and get it work again in desktop I will get the unique mobile issue.

AngelSanz1977 (talkcontribs)

First of all, thanks for this very useful extension!

I'm checking it and have one question that I am not able to solve

Is there any way to set priority to a specific page or for all pages? Maybe some var in the LocalSettings.php?

I have been reviewing the source extension (ManualSitemap) and I have seen that it had some configuration options in this regard. I tried to do tests modifying the LocalSetings file but I can not get any of them to work.

Any help will be appreciated!

Thank you!

Martynov Maxim (talkcontribs)

Check v1.3, I've added options for namespace, page or whole site priority set.

AngelSanz1977 (talkcontribs)

Thanks very very much my friend !!


AngelSanz1977 (talkcontribs)

Hello again Martynov,

I have already installed the updated extension and the new functionalities work correctly. Great job! Thank you!

Abusing your kindness I would like to ask you one last question. Unfortunately I have found a small problem that I can not solve:

When I add a priority exception for some page it stops working if the title of the page contains some special character, such as the letter "ñ" that we use in Spain or some letter with an accent, as "á" for example.

I have done some tests changing the coding but I can not get it to work. For example, in my main page ("Página principal" in spanish) in this way it does not work:

  • $wgAutoSitemap ["priority"] ['Página principal'] = 0.8;

But neither does it:

  • $wgAutoSitemap ["priority"] ['P%C3%A1gina principal'] = 0.8;

Nor with other combinations like this:

  • $wgAutoSitemap ["priority"] [''P%C3%A1gina_principal'] = 0.8;

Do you know if there is any way in which I can solve this problem?

If there is no way to fix it, I can always leave unchanged the pages with titles that contain some special character but in my language there are many of them and I prefer to ask you first.

Thank you very much again for your time and attention!

Best regards


Martynov Maxim (talkcontribs)

Can you add {{FULLPAGENAME}} to page and them check it return value? Extension uses exactly the same name as get by this function.

Also maybe there is some issue with files code page (non-Unicode). Which one do you use?

Grlucas (talkcontribs)

Since installing this extension on MW 1.33.0, saving a page takes about 8 to 15 seconds. Is this normal? Thanks.

Martynov Maxim (talkcontribs)

It seems like there are a lot of pages on your wiki or your server/php performance is limited/low.

AutoSitemap_body.php on line 97 error

Yedidyarashi (talkcontribs)

Warning: fopen(sitemap.xml.tmpf4de173a4f85e1bc051e0b5a9ced5390.tmp): failed to open stream: Permission denied in /opt/bitnami/apps/mediawiki/htdocs/extensions/AutoSitemap/AutoSitemap_body.php on line 97

Cannot write to sitemap.xml.tmpf4de173a4f85e1bc051e0b5a9ced5390.tmp.

Ciencia Al Poder (talkcontribs)
Yedidyarashi (talkcontribs)

sudo chmode +w mediawiki

sudo chown www-data. mediawiki

i added this code to htaccess.conf

<Directory "opt/bitnami/apps/mediawiki/htdocs/extensions/AutoSitemap/sitemap.xsl">

Allow from all



sudo /opt/bitnami/ctlscript.sh restart

and still it don't work

Ciencia Al Poder (talkcontribs)

The code in htaccess.conf is unneeded.

This will work only if PHP is being executed by www-data. (with the dot?). You should be sure that's correct in your system. However, the code is very stunky, and tries to write to a file without specifying a path. This gives no clue as to what folder it will write the file to (relative to index.php, or the extension's file that's currently running that code?). If in doubt, give all permissions to all subfolders (sudo find . -type d -exec chmod 777 {} \;) and try again to discard other issues.

Reply to "AutoSitemap_body.php on line 97 error"
Xsteeplol (talkcontribs)

When I edit or create a page on my wiki, I get this error: "ArgumentCountError from line 157 of /membri/solu/extensions/AutoSitemap/AutoSitemap_body.php: Too few arguments to function AutoSitemap::getPriority(), 0 passed in /membri/solu/extensions/AutoSitemap/AutoSitemap_body.php on line 229 and exactly 3 expected"

This is my configuration in LocalSettings:

wfLoadExtension( 'AutoSitemap' );

$wgAutoSitemap["filename"] = "sitemapp.xml";

$wgAutoSitemap["freq"] = "hourly";

$wgAutoSitemap["priority"] = 1;

how can I resolve it?

Martynov Maxim (talkcontribs)


Please download extension source code again, problem was fixed.

Xsteeplol (talkcontribs)

Thanks, now it works!

DataBase error after adding a new namespace to exclude

Nicolas NALLET (talkcontribs)

When I add a new namespace to exclude in $wgAutoSitemap["exclude_namespaces"] = like


and after when I try to edit a page on the wiki I get a database error.

Martynov Maxim (talkcontribs)

Can you attach trace log with debug mode enabled?

Nicolas NALLET (talkcontribs)

You can create an account on https://domotiki.eu and try to edit a page to see the full erro message

See https://domotiki.eu/domotique/Special:Version

Database error

A database query error has occurred. This may indicate a bug in the software.

[15d59b6bbc7b1e30c4d8f1f7] /index.php?title=Bac_%C3%A0_sable&action=submit Wikimedia\Rdbms\DBQueryError from line 1075 of /srv/data/web/vhosts/domotiki.eu/htdocs/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SELECT "Popularpages" AS type,

page_id AS id,

page_namespace AS namespace,

page_title AS title,

( MAX( rev_timestamp ) ) AS last_modification,

rev_timestamp AS value





page_is_redirect = 0

AND rev_page = page_id

AND page_namespace NOT IN (5,7,8,9,10,11,12,13,15,6,NS_WIDGET)

GROUP BY page_id

Function: Wikimedia\Rdbms\Database::query

Error: 1054 Unknown column 'NS_WIDGET' in 'where clause' (localhost)


#0 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/libs/rdbms/database/Database.php(933): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)

#1 /srv/data/web/vhosts/domotiki.eu/htdocs/extensions/AutoSitemap/AutoSitemap_body.php(104): Wikimedia\Rdbms\Database->query(string)

#2 [internal function]: AutoSitemap::writeSitemap(Revision, string, string)

#3 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/Hooks.php(186): call_user_func_array(string, array)

#4 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/Revision.php(1511): Hooks::run(string, array)

#5 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/page/WikiPage.php(1716): Revision->insertOn(Wikimedia\Rdbms\DatabaseMysqli)

#6 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/page/WikiPage.php(1619): WikiPage->doModify(WikitextContent, integer, User, string, array)

#7 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/EditPage.php(2161): WikiPage->doEditContent(WikitextContent, string, integer, boolean, User, string, array, integer)

#8 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/EditPage.php(1493): EditPage->internalAttemptSave(array, boolean)

#9 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/EditPage.php(637): EditPage->attemptSave(array)

#10 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/actions/EditAction.php(59): EditPage->edit()

#11 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/actions/SubmitAction.php(38): EditAction->show()

#12 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/MediaWiki.php(499): SubmitAction->show()

#13 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/MediaWiki.php(293): MediaWiki->performAction(Article, Title)

#14 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/MediaWiki.php(862): MediaWiki->performRequest()

#15 /srv/data/web/vhosts/domotiki.eu/htdocs/includes/MediaWiki.php(523): MediaWiki->main()

#16 /srv/data/web/vhosts/domotiki.eu/htdocs/index.php(43): MediaWiki->run()

#17 {main}

Martynov Maxim (talkcontribs)

I guess that you added new namespace in wrong way. NS_* are numeric constants, but in your case it is a string because PHP understand this unknown value as a string.

You should add new namespace properly.

Nicolas NALLET (talkcontribs)

When I try

php maintenance/eval.php

> var_dump(NS_WIDGET);

I get


Martynov Maxim (talkcontribs)

Add something like var_dump(NS_WIDGET); into LocalSettings.php before passing this namespace into an extension, and give an output here.

Exlude some other pages from sitemap

Fokebox (talkcontribs)

Hello all. Thank you for the extension. It works fine. I would like to know if it is possible to exclude some other pages at my wiki. For example I have my own namespaces "MiWiki:Article name" So I would like to exclude all pages with this namespace. How can I do it? And It would me fine for me to exclude all images in my sitemap. How to exclude them? Thank you!

Martynov Maxim (talkcontribs)

Hi. Add this item to you LocalSettings.php:

$wgAutoSitemap["exclude_namespaces"][] = NS_PROJECT;

Fokebox (talkcontribs)

Thank you! Now I excluded all images and project pages. And the final question how to exclude the topics like this one from the list of xml sitemap?

Martynov Maxim (talkcontribs)

You can find at extension page setting "exclude_pages"which excludes certain pages from sitemap.

Fokebox (talkcontribs)

Hi all and thanks for replies. I have set the extension as I wanted!

how to force to generate sitemap.xml ?

Alexandroslee (talkcontribs)

how to force to generate sitemap.xml immediately?

Martynov Maxim (talkcontribs)

Save something at any page, create new or delete.

2001:B011:4007:1A63:844C:5F26:D909:4B10 (talkcontribs)

got it! Thanks

There are no older topics