Home / Disable / Elementor – Fix the Accordion SEO issue
Duplicate Snippet

Embed Snippet on Your Site

Elementor – Fix the Accordion SEO issue

Code Preview
php
<?php
add_filter( 'elementor/widget/render_content', function ( $widget_content, $widget ) {
    if ( 'accordion' === $widget->get_name() ) {
        $widget_content = preg_replace(
            '/<a[^>]*class="elementor-accordion-title"[^>]*>(.*?)<\/a>/',
            '<span class="elementor-accordion-title">$1</span>',
            $widget_content
        );
    }
    if ( 'toggle' === $widget->get_name() ) {
        $widget_content = preg_replace(
            '/<a[^>]*class="elementor-toggle-title"[^>]*>(.*?)<\/a>/',
            '<span class="elementor-toggle-title">$1</span>',
            $widget_content
        );
    }
    return $widget_content;
}, 10, 2 );

Comments

Add a Comment