From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png

Release status:Extension status stable

ImplementationTemplate:Extension#type User rights, Page action
DescriptionTemplate:Extension#description Web service to add pages to the wiki.
Author(s)Template:Extension#username Fernando Correia (Fernando.correiatalk)
Latest versionTemplate:Extension#version 1.0.1 (2007-01-31)
MediaWikiTemplate:Extension#mediawiki 1.8.2, 1.9.1
LicenseTemplate:Extension#license No license specified
Download AddPageService.php

Translate the AddPageService extension if it is available at translatewiki.net

Check usage and version matrix.


AddPageService is a web service that enables external programs to add or edit pages on the wiki just as a regular user.



  • Can add or edit pages.
  • Impersonates a wiki user.
  • Requires user name and password.
  • Has the same behavior as a manual edit.
  • Silently replaces invalid characters in page titles.


  1. Install Snoopy. Download it and extract it into some directory.
  2. Install PEAR SOAP. For instance, execute this command in the php directory:
    pear install channel://pear.php.net/soap-0.10.1
  3. Download AddPageService.php and save it in the extensions directory of your wiki.


Edit the "Customization required" section in AddPageService.php:

  1. $wiki_root_url: Must point to the base URL of your wiki.
  2. Snoopy: Specify the correct path for the include directive for the Snoopy class.
  3. $debug_file_name: Specify a full pathname for a temporary debug file or an empty string to disable this feature.
    The debug file shows the wiki response to the request to open the edit form. Most problems can be diagnosed with the error messages in this file.
  4. $strict_title_rules: True to apply more strict rules about valid characters in page titles.
    With this option on, some characters that are valid but may cause problems will be substituted for spaces. For more information see Wikipedia:Naming conventions (technical restrictions).


  1. Download TestAddPage.php and save it in the extensions directory of your wiki.
  2. Edit the "Customization required" section in TestAddPage.php:
    • $endpoint: The full URL of the AddPage web service.
    • $user: A valid wiki user name.
    • $password: The password of the $user.
    • $title: The title of the test page to be created.
    • $text: The contents of the test page to be created.
  3. Using the full URL, open TestAddPage.php in your browser. For instance:
  4. The web service answer will be shown. It will be "OK" or an error message.
  5. Verify that the test page shows on the "Recent changes" page on the wiki.


Information about using the web service in external programs:

  • The web service URL will be similar to this:
  • The WSDL can be obtained by adding "?wsdl" to the URL, like this:
  • The web service method to be called is named addPage.
  • It has these parameters:
    1. title: page title (UTF-8 encoded).
    2. text: page text (UTF-8 encoded).
    3. user: wiki user name.
    4. password: wiki user password.
  • Use a high timeout. For instance, 30 seconds. The web service opens several web forms and may take a few seconds to answer.
  • Verify that the method returns "OK". Otherwise, show the returned error message.


Partially based on Bulk Page Creator.

Version history[edit]


Release date: 2007-01-31

  • Removes restricted characters from page titles.
  • Outputs debug file.


Release date: 2007-01-31

  • Initial release.



Use the discussion page for feedback, questions, feature requests and bug reports.