'Elementor nav includes invalid tags

I have an elementor page with a nav element.

The page returns a lot of errors on the w3c validator, like this one:

Error: Attribute migrated not allowed on element nav at this point.

<nav migration_allowed="1" migrated="0" role="navigation"
class="elementor-nav-menu--main elementor-nav-menu__container
elementor-nav-menu--layout-horizontal e--pointer-none">

I'm wondering how to remove these attributes, is it possible to edit the elementor pluign itself update-proof?

Or could I use a hook to edit it before rendering with PHP?



Solution 1:[1]

I had the same problem, i solved it with editing nav-menu.php on row 1276 bij adding two forward slashes before 'migration_allowed' and 'migrated'. It's NOT update-proof, but I'm working on a custom nav-menu-widget which will solve the update problem.

    $this->add_render_attribute( 'main-menu', [
        //'migration_allowed' => Icons_Manager::is_migration_allowed() ? '1' : '0',
        //'migrated' => $is_migrated ? '1' : '0',
        // Accessibility
        'role' => 'navigation',
    ] );

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Stefan