URLs
URLs get a language prefix automatically, and reading the active language is also automatic.
| Function | Without multilang | Under /es/ |
|---|---|---|
get_permalink($id) | https://site.com/blog/foo/ | https://site.com/es/blog/foo/ |
home_url('/about/') | https://site.com/about/ | https://site.com/es/about/ |
wp_nav_menu (links) | native | prefixed with /es/ |
System URLs (wp-admin, REST, feeds, sitemap) are excluded automatically. The site root (/) redirects to /{default-language}/.
Knowledge Check
Test your understanding of this section
Loading questions...