8 votes

What is a "data-ad-slot" for Google Adsense and why is inline styling required?

When you create an Adsense ad, you can select it to be either responsive or fixed size. If it's a fixed size, you'll get the sizing thrown into the ad as part of the styling: style="display:inline-...
Luis Alberto Barandiaran's user avatar
6 votes
Accepted

Why can't update.php connect to my database when my site connects to it just fine?

I seem to have resolved this by explicitly adding the socket to the $wgDBserver variable in LocalSettings.php. To get the socket path, I ran this query in my SQL database manager: show variables like '...
intcreator's user avatar
5 votes

File system permission for MediaWiki?

The following picks up on a fresh working LAMP installation under Red Hat 7 or clone (CentOS 7, Scientific Linux 7, Orcale 7, etc). Set Selinux to permissive for the installation. setenforce 0 First ...
Pozzo-Balbi's user avatar
5 votes
Accepted

How to use Wikipedia templates on an outside MediaWiki?

It's a PITA and unfortunately (unlike extensions or media files) there is no repository of canned templates. Templates load other templates which load others in turn, etc. Templates are there to ...
Rob Kam's user avatar
  • 545
4 votes

How to set the keep me logged in box to true in Mediawiki Special:UserLogin

(MediaWiki 1.31.0, edited 2020) Add to LocalSettings.php: $wgHooks['AuthChangeFormFields'][] = function ($requests, $fieldInfo, &$formDescriptor, $action) { $formDescriptor['rememberMe'] = ['...
alari's user avatar
  • 41
4 votes

How do you hot link an external image from a Media Wiki site?

Actually, [http://example.com/image.jpg] is not correct. The correct way to insert an external image into a wikimedia page is http://example.com/image.jpg eg. no square brackets. Of course, make ...
FastLearner's user avatar
4 votes

Clone an abandoned MediaWiki site

You can use the API to export all the text content, with something like action=query&generator=allpages&export. Files you'll have to scrape via some script, such as pywikibot. You can see what ...
Tgr's user avatar
  • 1,289
4 votes
Accepted

Clone an abandoned MediaWiki site

Backing up a wiki without server shell access, requires Python v2 (v3 didn't yet work last time I did this). From the command-line run the the WikiTeam Python script dumpgenerator.py to get an XML ...
Rob Kam's user avatar
  • 545
3 votes
Accepted

Where is "MediaWiki:Vector.css" of my MediaWiki

I asked a question in superuser and this answer was correct: MediaWiki:Vector.css is not a file on your filessytem. Its "just" a Wikipage. Just type "MediaWiki:Vector.css" in the searchbar and ...
hasanghaforian's user avatar
3 votes
Accepted

How to log-in with more rights than Admin or Bureaucrat?

There are privileges which bureaucrats do not have by default, and it is possible to give those to them (or some other group or a specific user if you prefer), e.g. $wgGroupPermissions['bureaucrat'] +...
Tgr's user avatar
  • 1,289
3 votes

Rewrite in Mediawiki, remove index.php, .htaccess

You can have clean URLs with the following step. Install the wiki into http://localhost/w and NOT into http://localhost/wiki then Modify the following in LocalSettings.php after you have set it up: $...
eQ19's user avatar
  • 131
3 votes

How do i edit Login Required Page

After searching for this answer. I finally found a Topic on MediaWiki Project:Support desk called Editing "Login Required" Page. It told me to Try editing the page mediawiki:loginreqpagetext on your ...
morgansbyers's user avatar
3 votes

MediaWiki: How to find all web pages with a certain HTML tag?

Take a backup first. Using phpMyAdmin (or similar) you can run an SQL query using REPLACE to update the tags in place. The 'text' table holds the pages for MediaWiki in the 'old_text' field. First ...
pbhj's user avatar
  • 203
3 votes
Accepted

<pre> tag generates a blue box behind the pre-formatted text and a table around it on the printable version. How to disable this?

whether or not there is a way to edit this, or change the table in any way or to turn this off when printable=yes? Yes to all question parts. The question "how" wasn't there, correct? Nevertheless: ...
Evgeniy's user avatar
  • 10.1k
3 votes

When MediaWiki has symbolic links to contents then LocalSettings.php is not found

Since the marked correct answer means copying ~27.5mb as of MediaWiki 1.38.1, which largely defeats the purpose of using symlinks, I found an alternative solution that avoids copying anything extra. ...
Kristen Ritterbush's user avatar
3 votes
Accepted

ServerAlias directive not working on Apache 2.4.49

It looks like perhaps the <VirtualHost> containers are defined/loaded in the wrong order and requests for XX.mediawiki.wordpressinstance.example are seemingly matching the wrong vHost. The first ...
MrWhite's user avatar
  • 42.8k
3 votes

Suggestions for tracking a MediaWiki wiki with Git version control?

It's a good impulse, what you're trying to do. You just need to scale back your expectations about what all gets tracked by Git. Because LocalSettings.php is the main thing, you definitely want to ...
Kevin E's user avatar
  • 221
3 votes
Accepted

Is it possible to use the "Pages in category..." list in mediawiki in a template without an extension?

If you wanted a list of subpages without needing to install an extension, yes, you can do that with Special:PrefixIndex. As for lists of pages in a category, I thought maybe Special:CategoryTree, but ...
Kevin E's user avatar
  • 221
2 votes

How to set the keep me logged in box to true in Mediawiki Special:UserLogin

We wanted to change the "Keep me logged in" (in German it's "Angemeldet bleiben") default as well, but overwriting the complete array $formDescriptor['rememberMe'] also removed the ...
Corben's user avatar
  • 121
2 votes

How to set the keep me logged in box to true in Mediawiki Special:UserLogin

The above answer will now throw fatal exception on Special:CreateAccount if anybody attempts account creation. You have to define the HTML form class. Something like this: // Check the password "...
Ammar's user avatar
  • 21
2 votes
Accepted

Why do MediaWiki's Infoboxes use Lua?

Lua is a programming language. See the Wikipedia Lua page for more information. This allows the info boxes to be more dynamic. The same info box can be shown on multiple pages and show slightly ...
Stephen Ostermiller's user avatar
2 votes
Accepted

changing color of body text on MediaWiki's "common.css" has no effect

The CSS-directive body { color: green; } is overwritten by directive on .mw-body { color: #252525; }. If you really want green copy-text use: .mw-body { color: green; };) But changing the font-...
klml's user avatar
  • 156
2 votes

How to render MediaWiki subpages' titles like the Spanish Wikibooks?

It seems it uses a JavaScript gadget called TitreDeluxe (Deluxe Title) from French Wikibooks. It is loaded from MediaWiki:common.js: mw.loader.load("//fr.wikibooks.org/w/index.php?title=MediaWiki:...
NinjaBearMonkey's user avatar
2 votes
Accepted

Trimming the last N changes in MediaWiki in order to "rebase" history from a Git-powered backup?

If you don't mind administrators being able to access those changes, the easiest is to revision-delete them: https://www.mediawiki.org/wiki/Help:RevisionDelete https://www.mediawiki.org/w/api.php?...
Tgr's user avatar
  • 1,289
2 votes
Accepted

Is it possible to hide Mediawiki redirect pages from showing in Special:AllPages?

To make the link to 'All Wiki Pages' in the sidebar display all pages but without redirects, navigate to www.example.com/w/MediaWiki:Sidebar and change: ** Special:AllPages|All Wiki Pages to ** //...
Paul's user avatar
  • 541
2 votes

Clone an abandoned MediaWiki site

Media-Wiki pages can be exported in a special XML format to upload import into another MediaWiki installation You can use 'Special:Export' usually in most standard Mediawiki. At lease you can get all ...
klml's user avatar
  • 156
2 votes
Accepted

Legal considerations regarding hosting a MediaWiki site

Any considerations should depend on your business, business model, website functionality, and so on. Keep in mind that as long as you collect personal data from users through your website, a Privacy ...
termsfeed's user avatar
  • 720
2 votes
Accepted

MediaWiki fails to show Ambox

Contrarily to what I originally thought, the AMBox template is not part of a standard MediaWiki installation. To make it works it is necessary to: If not already installed, install Scribunto ...
lucamauri's user avatar
2 votes
Accepted

How do you deal with mass spam on MediaWiki?

If configured properly, your proxy will add the IP address of the user to the X-Forwarded-For header of the backend request. If $wgSquidServers (or $wgSquidServersNoPurge) is properly set, MediaWiki ...
Tgr's user avatar
  • 1,289

Only top scored, non community-wiki answers of a minimum length are eligible