Skip to main content
Home
GrN.dk

Main navigation

  • Articles
  • Cases
  • Services
  • Your Digital Project Manager
  • About Greg Nowak
  • Image Gallery
  • Contact
User account menu
  • Log in

Join my community / free newsletter — sign up here

Breadcrumb

  1. Home

Drupal 8: How to Change Existing Content Language Safely

Illustrated infographic summarizing: Drupal 8: How to Change Existing Content Language Safely

By Greg Nowak. Updated 11 August 2026.

If an inherited Drupal 8 site contains Swedish pages labelled as English, changing the default language will not repair those records. Existing content keeps language metadata in several entity and field tables, where it can influence editing forms, Views, search, feeds, URL handling, and integrations.

Treat the change as a small data migration: define the intended result, inspect the actual schema, test a repeatable script in staging, and arrange editorial sign-off. This is especially important because Drupal 8 has received no security support since November 2021. A language repair may be justified, but it should sit inside a plan for moving the site to a supported Drupal release.

Are You Relabelling Content or Translating It?

Start with the business requirement. If a Swedish article was mistakenly stored with langcode = 'en', you may need to relabel its source language as sv. If the organisation wants separate English and Swedish versions, that is content translation—not a database replacement.

Drupal’s current multilingual documentation explicitly warns against changing the site’s default language after content has been added. It also explains that translations share an entity ID while language-specific values are stored separately. That structure is why a broad search-and-replace is unsafe.

What you find Likely requirement Recommended route
Swedish-only content incorrectly labelled en Relabel the existing source content Controlled data repair in staging, followed by production
Both en and sv rows for the same entity Preserve real translations Stop and map each translation before writing SQL
Editors need both languages going forward Introduce a translation workflow Configure Content Translation by entity type, bundle, and field
Custom entities or integrations use language filters Repair a wider data contract Include application and integration testing in the scope
A decision matrix for choosing between relabelling, translation, and a broader migration.

Inventory the Database Before Writing the Repair

Clone production and take a complete backup before investigating. Then identify every table containing Drupal’s common language metadata columns. On MySQL or MariaDB, this discovery query provides a useful starting point:

SELECT TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
  AND COLUMN_NAME IN (
    'langcode',
    'default_langcode',
    'content_translation_source'
  )
ORDER BY TABLE_NAME, COLUMN_NAME;

Review nodes, taxonomy terms, revisions, custom field tables, reusable blocks, menu links, redirects, aliases, and custom entities. Not every discovered column should be changed. In particular, default_langcode and content_translation_source express translation state; they are not interchangeable with a simple human-language label.

Before changing en to sv, check whether a Swedish row already exists for the same entity. This basic node query should return no rows for a straightforward relabelling:

SELECT en.nid
FROM node_field_data en
INNER JOIN node_field_data sv
  ON sv.nid = en.nid
 AND sv.langcode = 'sv'
WHERE en.langcode = 'en';

Run an equivalent check for taxonomy terms and every other translated entity type. A result indicates a collision: blindly updating the English row could violate a key, overwrite a translation, or leave the entity inconsistent.

Use SQL as a Reviewed Migration, Not a Global Replacement

For a simple site with no existing Swedish translations, the reviewed script may begin with the following core tables. This is a shape to adapt to the site’s schema, not a universal script:

UPDATE node
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE node_field_data
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE node_revision
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE node_field_revision
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE taxonomy_term_data
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE taxonomy_term_field_data
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE taxonomy_term_revision
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE taxonomy_term_field_revision
SET langcode = 'sv'
WHERE langcode = 'en';

Translated field values also live in tables such as node__field_*, node_revision__field_*, and their taxonomy equivalents. Inventory and update each applicable table explicitly. Keeping the SQL in version control makes peer review, staging rehearsal, and production repetition much safer than pasting commands into an interactive console.

Run the Change as Planned Maintenance

Arrange a content freeze so editors, imports, queues, and integrations do not write competing records. Use the project-local Drush version from the Drupal root, and select the correct alias or --uri on multisite installations. Because legacy projects may pin an older Drush release, confirm the available syntax with vendor/bin/drush help sql:query.

vendor/bin/drush @site sql:dump \
  --result-file=../before-language-change.sql

vendor/bin/drush @site sql:query \
  --file=change-language.sql

vendor/bin/drush @site cache:rebuild

A language-row repair does not itself require updatedb. Run database updates only when the maintenance window also includes a code deployment with pending Drupal update hooks. Rebuild any external search index separately if it stores language metadata.

Test the Journeys the Business Depends On

  • Compare record counts by language before and after the migration.
  • Open representative nodes, terms, revisions, and translated field values.
  • Create new content and confirm its bundle uses the intended language default.
  • Test editing, preview, publishing, moderation, revision rollback, and translation screens.
  • Check Views, menus, aliases, redirects, search, feeds, JSON responses, and language-filtered integrations.
  • Review logs, then obtain sign-off from an editor who understands the affected content.

The safest outcome is not merely “the SQL ran.” It is that editors can work normally, customer-facing journeys remain intact, and the team knows how to restore the previous state. If you need someone to turn an uncertain Drupal language problem into a scoped maintenance plan, bring Greg in before production is changed.

Related on GrN.dk

  • Drupal CMS 2.0 Speeds Marketing Site Rebuilds, but It Is Not Autopilot
  • Google’s AI Search toggle needs a test plan, not a gut decision
  • Google’s August 18, 2026 Content API Cutoff: Feed Cleanup Before Merchant API Migration

Need help with this kind of work?

Plan a safe Drupal language repair Get in touch with Greg.

Sources

  • Install a language | Drupal Multilingual Guide
  • Content Translation module overview
  • Drupal 8 is now end-of-life
  • Drush sql:query command
  • Drush sql:dump command
Last modified
2026-08-12

Tags

  • Drupal 8
  • Multilingual Drupal
  • Drupal Migration
  • Drush
  • Legacy Drupal

Review Greg on Google

Greg Nowak Google Reviews

 

Written recommendations from Trafik og Veje, Aarhus Municipality (2011) and AgroTech (2010) — read them on LinkedIn.

Illustrated infographic summarizing: From Supplier Invoice to Bookkeeping: AI with a Control Checkpoint
From Supplier Invoice to Bookkeeping: AI with a Control Checkpoint
2026-08-18

AI can reduce the work involved in processing supplier invoices, but reliable bookkeeping requires validation, duplicate checks, approval and a clear audit trail.

Illustrated infographic summarizing: Nginx 1.30 Changed the Upstream Defaults—Test Before You Upgrade
Nginx 1.30 Changed the Upstream Defaults—Test Before You Upgrade
2026-08-17

Nginx 1.30 defaults upstream proxying to HTTP/1.1 with keepalive enabled. Here is what to inspect, model and test before upgrading.

Illustrated infographic summarizing: OpenAI’s Assistants API Shuts Down in Ten Days. Is Your App Ready?
OpenAI’s Assistants API Shuts Down in Ten Days. Is Your App Ready?
2026-08-16

OpenAI’s Assistants API shuts down on August 26, 2026. Learn what to inventory, how to preserve state and how to cut over without breaking the product.

Illustrated infographic summarizing: WordPress 7.1 Forces the Editor Into an iframe—Test Your Custom Blocks
WordPress 7.1 Forces the Editor Into an iframe—Test Your Custom Blocks
2026-08-15

WordPress 7.1 removes the non-iframe editor fallback. Learn how to audit custom blocks, test real workflows and fix compatibility issues before launch.

Illustrated infographic summarizing: GitHub will stop sending jobs to stale self-hosted runners
GitHub will stop sending jobs to stale self-hosted runners
2026-08-14

GitHub starts enforcing runner versions on August 24, 2026. Audit and upgrade self-hosted runners before builds and deployments start stalling.

Illustrated infographic summarizing: Your AI Agent Has Shell Access. What Can It Reach?
Your AI Agent Has Shell Access. What Can It Reach?
2026-08-13

A practical guide to mapping what a shell-enabled AI agent can reach, then containing its access to files, credentials, networks, tools, and high-impact actions.

Illustrated infographic summarizing: Cloudflare Changed DoH JSON. What Else Is Parsing DNS as Text?
Cloudflare Changed DoH JSON. What Else Is Parsing DNS as Text?
2026-08-12

Cloudflare’s DoH JSON change exposes brittle DNS parsing. Find affected scripts, test both formats, and choose a safer integration contract.

Illustrated infographic summarizing: Your Website Can Answer Questions Now. Should It?
Your Website Can Answer Questions Now. Should It?
2026-08-11

NLWeb makes conversational website search practical to deploy. The real question is whether your content, users and team are ready to support it.

Illustrated infographic summarizing: AI Search Finally Has Reports. Now Connect Visibility to Revenue
AI Search Finally Has Reports. Now Connect Visibility to Revenue
2026-08-11

Google and Bing now expose first-party AI search data. The real task is connecting citations and impressions to analytics, CRM outcomes, and revenue.

Illustrated infographic summarizing: The Bot Passed Your CAPTCHA. What Did It Do Next?
The Bot Passed Your CAPTCHA. What Did It Do Next?
2026-08-11

Passing a challenge is only one signal. Session analysis, server-side validation and endpoint-specific controls help reduce bot abuse without blocking customers.

More articles

Built by AI — available for your business. The daily articles on this site are researched, written and illustrated by an autonomous AI pipeline. At nowa.dk I install the same kind of AI automation in businesses at fixed prices — site in Danish, English version here, and web/marketing agencies have a dedicated page.

RSS feed

Footer

  • All articles
  • Contact

GrN.dk — AI automation, web platforms, web optimization, data handling and logistics.

© 2026 GrN.dk · LinkedIn · Contact · AI automation in Danish: nowa.dk

Behind GrN.dk: Individual Entrepreneur Codecrafter · Tax ID 305669096 · Bakhtrioni St. 22, 0194 Tbilisi, Georgia · official business register