Your own custom maintenance mode for WordPress

The custom maintenance mode message in WordPress, during upgrades and installs, is far from beautiful 🙂 Time to change that! You can do your own page by adding a pure PHP maintenance.php into your /wp-content folder. Now go and build a nice page ! Just remember that during maintenance no WordPress functionality is available! Enjoy coding …

You might not need jQuery or Javascript!

Transition jQuery has provided easy access to complicated core Javascript solutions in the past and has been shielding us from difficult workarounds for legacy browsers. But times have changed and many of those things can be done as easily using Javascript directly. jQuery is a fast, small, and feature-rich JavaScript library. It makes interactions with HTML documents […]

WPML – Going multilingual with WordPress

Getting started “WPML (WordPress Multilingual) makes it easy to build multilingual sites and run them. It’s powerful enough for corporate sites, yet simple for blogs.” – WPML I have been running and setting up multilingual websites for more than 12 years. WordPress and related integrations have gladly come a long way to make our life’s […]

WP REST API rendered output & Visual Composer

Visual Composer shortcodes are normally not converted within the WordPress REST API rendered output. This can be accomplished by calling WPBMap::addAllMappedShortcodes(); add_action( ‘rest_api_init’, function () { register_rest_field( ‘page’, ‘content’, array( ‘get_callback’ => ‘convert_do_shortcodes’, ‘update_callback’ => null, ‘schema’ => null, ) ); }); function convert_do_shortcodes( $object, $field_name, $request ) { WPBMap::addAllMappedShortcodes(); // This does all the work global […]

World Grain / Milling & Grain – vibronet® advertisment 2025

World Grain + Milling & Grain magazine advertisment 2025 World GrainMilling & Grainvibronet® Gräf GmbH & Co. KG

WordPress: Caching MO-files … Does it make any sense!

First a bit of context 🙂 What is Gettext? Translation within WordPress is based of Gettext. Gettext is a software internationalization and localization (i18n) framework used in many programming languages to facilitate the translation of software applications into different languages. It provides a set of tools and libraries for managing multilingual strings and translating them […]

WordPress Plugins & Sessions

START SESSION ON INIT add_action(‘init’, ‘pluginStartSession’, 1); function pluginStartSession() { if(!session_id()) { session_start(); } } NEW SESSION ON LOGIN / LOGOUT add_action(‘wp_logout’, ‘pluginEndSession’); add_action(‘wp_login’, ‘pluginEndSession’); function pluginEndSession() { session_destroy (); } Now go ahead and use $_SESSION freely in your plugin. Here a nice additional class to  encrypt session data. Enjoy coding ….

WordPress Cron + WP-CLI + Ntfy

THE GOAL Create a system cron for WordPress, that is accessible and can be easily tweaked to provide more details. Here some basic information about crons and the tools I am going to use … WordPress CRON In WordPress, the term “cron” refers to the system used for scheduling tasks to be executed at predefined […]

WordPress + Query_Posts + Sticky + Pagination

We often have some posts that we would like to promote and keep at the first page of the blog. When you are using pagination, the sticky posts will be added to the standard posts, making the post count per page uneven. If you want to keep your posts per page count consistent, there is […]

Willen Logistics | Business Cards

I designed a fresh set of business cards for Willen Logistics last year, this is a small iteration with a QR-Code on the back. The business cards feature a partial varnish on the logo and QR-Code. I updated their different logos last year, to streamline their main corporate colors. “Seit mehr als 50 Jahren ist […]

Solutions: WordPress + MultiSite + WPML + Simplied folder structure

4. May 2024
.SHARE

Table of Contents

THE QUESTION

A while back a potential customer asked me, if it is possible to restructure a WordPress Multisite setup and WPML with a more simplified and custom url structure?


THE ROUGH IDEA

1 . BASE.website web.site (with possibly different languages)

web.site/de/
web.site/en/

2. SUB.website web.site/nl-nl/ 

Languages would normally be added like this:

web.site/nl-nl/de/
web.site/nl-nl/en/

The customer wanted it to be restructured / simplified like this:

web.site/de-nl/
web.site/en-nl/

This basically mimics the structure of a single WPML website with custom languages, but with all the benefits of a multisite.

THE SOLUTION

This is nothing that WPML or WordPress Multisite provides out of the box. 
I built a prototype setup to make it work. 

Not something that I would propose for anyone, as it requires a lot of tweaks for anything that handles dynamic links (plugins, hooks, core systems, page.builder …) 

Its doable 🙂

BASIC URL HANDLING

One thing that needs to be tweaked globally, is the mapping of the new url structure.

So web.site/nl-nl/en/ needs to become web.site/en-nl/

This needs to be handled on the server side, by proxying the original to the new structure.
This can be easily done using Apache or NGINX.

With that web.site/nl-nl/en/ will be proxied to web.site/en-nl/, but any core navigation will not work yet.

This is the fastest solution that I came up with, within the hour I gave myself 😉 

There surely are other options, like the core rewrites / restructuring of the core shorturl handling. But these approaches might break things in far more areas. 

Using the proxy approach, keeps the core as it is. The solution needs to be as simple as possible, allowing to maintain it in the future 🙂

HOOKS TO THE RESCUE

Just for the basic setup a couple of hooks are required to make this work, more might be needed depending on the plugins in use.

Here a couple of examples ….
WordPress site_url

WordPress Nav Links

WPML

Rankmath

This will not cover every angle, but will give you a starting point! I love my puzzles and there always is a viable solution 🙂

Need something similar … get in touch!

Happy coding …

Let’s Talk!

Looking for a reliable partner to bring your project to the next level? Whether it’s development, design, security, or ongoing support—I’d love to chat and see how I can help.

Get in touch,
and let’s create something amazing together!

RELATED POSTS

Pushing the Boundaries – My Journey Through Early CMS and PHP Development

Back in the early 2000s, content management systems (CMS) were still in their infancy. Websites were mostly static, and managing content dynamically required custom scripts or early blogging tools. My journey into CMS development started with Greymatter, took me through PHP-Nuke, PostNuke, and XOOPS, and ultimately shaped my understanding of PHP and modular web development. […]

Enhancing WordPress Development with the Timber Template System

WordPress has long been the go-to CMS for developers and designers, but its traditional PHP-based templating system can sometimes feel outdated and cumbersome. Enter Timber, a powerful templating framework that brings the flexibility and clarity of the Twig templating language to WordPress. With Timber, developers can separate logic from presentation, leading to cleaner, more maintainable code. All my […]

Day 4: Kimai Time Tracking – 7 Days of Docker

Kimai is a powerful open-source time-tracking application that helps businesses and freelancers efficiently manage work hours and billing. It supports multi-user environments, customizable reporting, and integrations with various tools. In this guide, we’ll walk through setting up Kimai using Docker and explore how to use it effectively. Why Use Kimai with Docker? Running Kimai with […]

Alexander

I am a full-stack developer. My expertise include:

  • Server, Network and Hosting Environments
  • Data Modeling / Import / Export
  • Business Logic
  • API Layer / Action layer / MVC
  • User Interfaces
  • User Experience
  • Understand what the customer and the business needs


I have a deep passion for programming, design, and server architecture—each of these fuels my creativity, and I wouldn’t feel complete without them.

With a broad range of interests, I’m always exploring new technologies and expanding my knowledge wherever needed. The tech world evolves rapidly, and I love staying ahead by embracing the latest innovations.

Beyond technology, I value peace and surround myself with like-minded individuals.

I firmly believe in the principle: Help others, and help will find its way back to you when you need it.