ReplyAndClose gives admins and discussions moderators the ability to simultaneously post a final reply and close the thread. The script can be configured to set the reason for closing the thread, the default reply and an object for storing generic replies.

Note that this works only on board threads.


Add the following to your Special:MyPage/common.js for personal use, or MediaWiki:Common.js for site wide use:

    type: 'script',
    articles: [
        // ...
        // ...


Key Description Type Default
reason Reason for closing the thread string see reply $1*
def Default reply string
generic An object for storing generic replies object {}
  • $1 is changed to a link to the reply that you'll be posting; format: [[#<number>]]

All configurations made to the script are to be stored in the replyAndClose object, like so:

window.replyAndClose = {
    reason: 'Please see reply $1 for the reason',
    def: 'Hello!\n\nThis thread is a violation of our [[:Category:Site policies|policies]] and is thus being closed. Please contact an [[Special:Listusers/sysop|administrator]] if you feel like this was a mistake.\n\nThanks.',
    generic: {
        'inappropriate': 'Hi!\n\nThe topic of this thread is inappropriate for this wiki, which is why I\'ve closed it. Please see to it that this does not happen again.\n\nThanks.',
        'offtopic': 'Hi!\n\nWhile we appreciate the time you took to post a thread here, the topic is not suitable for {{SITENAME}}. This thread will be closed now, but we hope that your next post will be on-topic.\n\nThanks.',
        'archive': 'This thread has long served its purpose and has been target to spam replies. It does not need to be open any longer.'

Remember, this goes above the import call!


The script uses the following messages. Use the talkpage to provide missing translations.

Key Message
title Reply and close
placeholder Write your reply here
cancel Cancel
preview Preview
post Post
generic Choose a generic reply
empty Your reply cannot be empty!
statusPreview Generating preview
statusPost Posting reply
statusClose Closing thread
errorClose An error occurred while closing the thread
errorPost An error occurred while posting your reply
errorPreview An error occurred while generating preview

These messages can be compiled to a single object with the language code (use the name if you're not sure):

        en: {
            title: 'Reply and close',
            placeholder: 'Write your reply here',
            cancel: 'Cancel',
            preview: 'Preview',
            post: 'Post',
            generic: 'Choose a generic reply',
            empty: 'Your reply cannot be empty!',
            statusPreview: 'Generating preview',
            statusPost: 'Posting reply',
            statusClose: 'Closing thread',
            errorClose: 'An error occurred while closing the thread',
            errorPost: 'An error occurred while posting your reply',
            errorPreview: 'An error occurred while generating preview'


May 15, 2016
Initial release.