Skip to main content
Last updated: 21 Jul 2026

Support government changes

Change a government in Whitehall

Following a General Election or other reason for governmental change, the current Government in Whitehall will need to be closed, and a new one created.

The Content Support team will normally be the ones who close the government and re-assign ministers once a new government has been opened. However, a developer will often be required to monitor the queues, as detailed below.

Closing a government

Governments are listed at the governments path of Whitehall Admin.

A government is considered “closed” when an end date is set. Depending on what you want to action, there are two possible paths.

Setting an end date for the government

  1. From the governments list, select ‘Edit’ for the current government
  2. On the government’s ‘Edit’ page, input an ‘End date’ and click ‘Save’

This closes the current government and triggers downstream republishing of associated documents.

Closing the government and all the ministerial appointments

  1. From the governments list, select ‘Edit’ for the current government
  2. Click the Prepare to close this government link
  3. Close the government - note that this may take some time, be patient after clicking the button

This will set an end date for the current government, closing it, and it will also remove all ministerial appointments. If an end date has already been set, actioning the close of government in this manner will not override the original end date.

Closing the government will cause a high number of documents to be represented by the Publishing API via link expansion. This happens on the lower priority queue and should not interfere with the publication of urgent content under the new government. Note that it is not required to action any additional republishing of documents. Previous tests have shown that it takes around 3.5 hours for the queues to clear in integration / staging.

Grafana monitoring for the Publishing API queues:

Open a new government

Create a new government

This will instantly create a new government. Changes can be seen in the Rails console by running Government.current.

Applying a banner to political content published by the previous government

Content in Whitehall can be marked as political, either automatically on publishing (if deemed political by the PoliticalContentIdentifier), or manually post-publication (through checking the “Political?” checkbox). Political content which was published under a previous government is historic?, and is highlighted both on the page and in search results - see examples:

This feature is also known as history mode.

Backdating

If we need to backdate a government or split a single government into two distinct dates, we need to run a rake task to republish all political content from Whitehall to properly associate content with the government at its first published date:

k exec deploy/whitehall-admin -- rake election:republish_political_content

Ending ministerial roles without closing a government

If we need to end all ministerial roles without explicitly closing a government, we can run a rake task:

k exec deploy/whitehall-admin -- rake election:end_ministerial_appointments

This will end all ministerial roles except the Prime Minister. You might have to do that one manually. Note that the rake task takes an optional date parameter, if you wish to specify an end date other than ‘today’.

Machinery of Government Changes

Following machinery of government changes, developers can help content designers make bulk changes to documents and users.

Bulk changing users

There is a Rake task in Signon to change the organisation that a user belongs to in bulk. However, it may be necessary to leave the old users around so they can still edit content for the old organisation (in which case you can bulk invite new users using the interface in Signon).

The rake task for changing the organisation the user belongs to is:

data_hygiene:bulk_update_organisation[csv_file].

It accepts a CSV file which should have at least the following columns (in any order):

Column Header Description
Old email The old email address of the user.
New email The new email address of the user.
New organisation The slug of the new organisations for the user.

We should phase out CSV-reliant rake tasks now that we’re on Kubernetes. In the meantime, follow the working with CSVs on Kubernetes instructions.

Bulk retagging documents

In Whitehall, there is a retagging form accessible from the “More” link in the menu: https://whitehall-admin.publishing.service.gov.uk/government/admin/retagging

The form allows anyone with the GDS Editor permission to change the lead and supporting organisations that a document is tagged to in bulk. It accepts CSV contents which should have at least the following columns (in any order):

Column Header Description
URL The URL of the document.
Lead organisations The slugs of the new leading organisations (separated by a comma). These will replace any existing organisations.
Supporting organisations The slugs of the new supporting organisations (separated by a comma). These will replace any existing organisations.

In Manuals Publisher, there is a rake task to change the organisations for a manual.

For Mainstream Publisher documents, a data migration is required to change the organisations for documents. Depending on the requirements, we might need to replace all currently tagged organisations with the new one only, (example PR: Migrate Publisher docs for replacing all tagged organisations) or just replace the old one with a new one, leaving other tagged organisations intact (example PR: Migrate Publisher docs for replacing only the old organisation).

For Specialist Publisher, you’d need to change the organisations property in all applicable finder JSON files, and republish said finders. The specialist documents themselves live entirely in Publishing API so would need retagging as per the instructions below.

For anything else, in Publishing Api, the task responsible for retagging documents is data_hygiene:bulk_update_organisation[csv_file]. Note that you should always update via the Publishing apps themselves where possible - this rake task is a last resort. Note also that the task depends on uploading a CSV file to Kubernetes, which is not ideal and should be phased out. In the meantime, follow the working with CSVs on Kubernetes instructions. It accepts a CSV file listing the document’s slug and new associated organisations:

Column Header Description
path The slug of the document.
all organisations The slugs of the new organisations (separated by a comma). These will replace any existing organisations.

Reorder ministers/peoples role titles

During a reshuffle, a minister can gain two positions of state, known as RoleAppointments in Whitehall. One of these is perceived to be a more senior role than the other.

To reorder a minister or persons titles, visit the following URL, replacing <person-name> with the hyphenated name of the person:

https://whitehall-admin.publishing.service.gov.uk/government/admin/people/<person-name>/reorder_role_appointments

For example, for Rishi Sunak it would be:

https://whitehall-admin.publishing.service.gov.uk/government/admin/people/rishi-sunak/reorder_role_appointments