The notice "Remember that this is only a preview. Your changes have not yet been published!" appears when simply editing a page (message can be found in MediaWiki:Previewnote). It also appears when clicking the Preview button.
Two ways to get rid of it:
1. Add in css (easier and safer, applies for both scenarios)
.previewnote {
display: none;
}
2. Find the following code in resources/Resources.php and delete it (applies to first scenario, i.e. when editing)
[
'name' => 'resources/src/mediawiki.action/mediawiki.action.edit.preview.parsedMessages.json',
'callback' => static function ( MessageLocalizer $messageLocalizer ) {
return [
'previewnote' => $messageLocalizer->msg( 'previewnote' )->parse(),
];
},
// Use versionCallback to avoid calling the parser from version invalidation code.
'versionCallback' => static function ( MessageLocalizer $messageLocalizer ) {
return [
'previewnote' => [
// Include the text of the message, in case the canonical translation changes
$messageLocalizer->msg( 'previewnote' )->plain(),
// Include the page touched time, in case the on-wiki override is invalidated
Title::makeTitle( NS_MEDIAWIKI, 'Previewnote' )->getTouched(),
],
];
},
]
Tested in Mediawiki 1.39.10