Skip to main content
Table of contents

Publishing

Change a slug and create redirect in Whitehall

Change a slug and create a redirect in Whitehall

In Whitehall, we have Rake Tasks to change slugs and create redirects for various entities: Person, Role, Document, PolicyGroup, WorldLocation, Organisation, WorldwideOrganisation and StatisticsAnnoucement.

Rake Tasks

These Rake Tasks also reindex the entity with its new slug and republish it to Publishing API, which automatically handles the redirect. They all take the old slug and the new slug as arguments.

Issues

If you run a task and find the redirect has worked but the new location returns a 404, it’s likely because the republish command is languishing in the low-priority queue (check queue volumes in Grafana). Whitehall appears to put the redirect in the high priority queue, so there can be a delay between the redirect being applied and the content being republished.

This should resolve itself over time, but if you need to process the content change more quickly, run represent_downstream:high_priority:content_id[CONTENT_ID] to put it in the high priority queue: - in integration - in staging - in ⚠️ production ⚠️

This page was last reviewed on 24 May 2020. It needs to be reviewed again on 24 November 2020 by the page owner #govuk-developers .
This page was set to be reviewed before 24 November 2020 by the page owner #govuk-developers. This might mean the content is out of date.