Commons:Rename a template

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

How to – step by step[edit]

Screenshot of the move page. (Admin accounts have some more check boxes.)
  1. Go to the template page you want to move. Click on down-pointing triangle in the top-right corner (next to edit and history). Click the move link.
  2. You will arrive at the move page. On this page:
    • Pick the new template name and namespace. In majority of the cases the namespace will remain Template.
    • Explain reason for the move
    • If your an admin, in most cases you should check the box Leave redirect behind so the old template name still works after the move. Also so the links to the old template can find it.
    • Template talk pages should be moved as well. You can check the box Move associated talk pages on the move page, otherwise you will need to move it separately.
    • Many template have subpages like: doc for documentation; layout, en, i18n, etc. for internationalization; or sandbox and testcases for testing and debugging and they should be moved as well. Admins can move them by checking the Move subpages check box, others would have to move them individually. After the move old template subpages will have redirects, the reliance on those should be removed, by altering the template and its subtemplates to call the new sub-templates instead of the old ones.
  3. In some cases one might want to replace all uses of the old template with a new one. To do so go to the old template page and click What links here on the left side of the page to look up all the pages that link to or transclude the old template. Alternatively you can go to Special:WhatLinksHere and type in the old template name to do the same. Edit all the pages listed there and replace all the uses of the old template with the new one. If the number is too large for manual edit you can request a bot to do the job.
  4. The last step would be the clean-up, where all the templates and sub-templates which are no longer used or linked to, can be deleted. That step is most easily done by an admin, but others could add a speedy-deletion-request by adding {{speedydelete|<Reason>}} to the old template pages.

See also[edit]