Help:Excluding a page from an inline query

Quering other pages with the same value
If on a certain page, say page A, you need to create a list of other pages with the same property value(s), it would make good sense to exclude page A from the query.

Below you will three possible solutions. The last two of these assume that you are using templates to handle properties on pages of a certain type.

1. Excluding the current page with Extension:Semantic Extra Special Properties

 * Install
 * Add the special property for the revision ID, for example by adding the following to line to your "LocalSettings.php":
 * Version 1.5.0 and earlier
 * Version 2.0 and later
 * Run
 * Add  to the query string of the inline query.

2. Comparator "!"
Wildcards and comparators in inline queries can be used only on properties of type 'Text', not on page names. For this reason, the following will not produce the intended results:

Instead, create a new property of type 'Text' (Property B in our example) and make sure that it gets its values from the page name. For instance, include the following silent annotation in your template:

In this way, you will be able to use the ! parameter for negation:

Similarly, for a Concept

... ... }}

excludes pages with Bar and Car defined for Property B

3. Template
You can also choose format=template and create a new template in which you exclude the results if the parameter for the page matches PAGENAME. For instance, assuming that the first value in the template corresponds to the name of the page you are using it for:

Note, however, that the default parameter does not work in this case, because the results are filtered out from the query after the query has been performed.