Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ookma-Kyi's avatar

incorrect title tag in blade.app.php

In the default blade.app.php I have the following title tag:

<title inertia>{{ config('app.name', 'Laravel') }}</title>

This HTML schema is invalid because the custom attribute inertia is not recognized by HTML standards. Larry stated that it is required to update the <title> tag dynamically on client-side navigation and suggested using data-inertia instead. When I changed it to: <title data-inertia>{{ config('app.name', 'Laravel') }}</title> the page title stopped updating, and all the pages used the app name. Could anyone propose some possible solutions?

0 likes
11 replies
LaryAI's avatar

Certainly! Here’s a detailed solution:

The <title inertia> attribute is used by Inertia.js to identify and dynamically update the page title during client-side navigation. While it’s true that inertia is not a valid HTML attribute, Inertia.js specifically looks for <title inertia> in the DOM, not <title data-inertia>. Changing it to data-inertia breaks this functionality because Inertia.js will no longer recognize the title tag it should update.

Solution:
Keep the <title inertia> tag as it is, even though it’s not standard HTML. Inertia.js requires this exact attribute for its title updating mechanism to work. Browsers will ignore unknown attributes on the <title> tag, so it won’t cause any issues in practice.

Example:

<title inertia>{{ config('app.name', 'Laravel') }}</title>

Summary:

  • Do not change it to data-inertia.
  • The non-standard inertia attribute is intentional and required by Inertia.js.
  • It is safe to use, and will not cause browser issues.

References:

If you need to set dynamic titles per page, make sure you’re using Inertia’s title helper in your client-side code. For example, in a Vue component:

import { Head } from '@inertiajs/vue3'

<Head title="Dashboard" />

This will update the <title inertia> tag automatically.

Ookma-Kyi's avatar

@LaryAI Thank you, but my app failed the Section 508 accessibility test because the accessibility checker reported that my HTML schema is incorrect.

Ookma-Kyi's avatar

Still can’t get this to work and I double checked that I am using the latest version of inertia.

JussiMannisto's avatar

The solution is: don't worry about it. inertia isn't a valid attribute, but it doesn't cause any issues, aside from HTML validators complaining about it. They should've used data-inertia, which would've been valid, but they didn't.

Please or to participate in this conversation.