Allow me to show you How to Remove Duplicate Meta Descriptions … If you’re using Elementor with the Hello theme and a child theme, you may run into an SEO issue where duplicate meta description tags appear on certain post types. This problem can lead to errors in SEO audits, impacting your site’s optimization. In this blog post, I’ll walk you through how I identified and fixed this issue, ensuring only one meta description tag is output on your pages.
The Problem: Multiple Meta Descriptions
While running an SEO audit, I encountered an error stating that multiple meta descriptions were present on the same page. At first, I couldn’t figure out why this was happening since I was using an SEO plugin (e.g., RankMath, Yoast, or All-in-One SEO) to manage my meta descriptions.
Here’s what I discovered:
- The issue occurred only on specific post types such as blog posts, landing pages, and WooCommerce products. Regular pages were unaffected.
- Upon inspecting the page source, I found two meta descriptions:
- The one I configured in RankMath.
- Another that was being generated by the Hello theme.
This unnecessary meta tag from the Hello theme was causing the conflict.
Finding the Culprit
To identify the source of the extra meta description, I:
- Viewed the source code: By searching for “meta description” in the page source, I confirmed the presence of two tags.
- Checked the Hello theme’s code: Navigating to the theme file editor in WordPress, I examined the parent Hello theme’s
functions.php
file.
In the functions.php
file, I located the problematic code:
- The function
hello_elementor_add_description_meta_tag
was generating a meta description tag based on the post excerpt. - This function was hooked into the
wp_head
action, which outputs content in the<head>
section of your pages.
Temporary Fix: Editing the Parent Theme
When I initially tries to figure out How To Remove Duplicate Meta Descriptions, I commented out the code responsible for outputting the extra meta tag. Specifically:
- The
echo
statement on line 204 in thefunctions.php
file was temporarily disabled. - After saving the changes and refreshing the page, the extra meta description tag was gone.
However, this solution was temporary because any future updates to the Hello theme would overwrite the changes.
How To Remove Duplicate Meta Descriptions
The Permanent Solution: Using a Child Theme
To implement a lasting fix, I removed the Hello theme’s meta description function by overriding it in my child theme. Here’s how:
// Disable the parent theme's description meta tag
function remove_hello_elementor_description_meta_tag() {
remove_action( 'wp_head', 'hello_elementor_add_description_meta_tag' );
}
add_action( 'after_setup_theme', 'remove_hello_elementor_description_meta_tag' );
- Re-enable the Original Code: I uncommented the changes in the Hello theme to restore its original functionality.
- Switch to the Child Theme: Using the theme editor, I accessed the
functions.php
file of my child theme. - Add Code to Remove the Function: I added the following snippet to disable the parent theme’s meta description function:
- Save and Test: After saving the changes, I refreshed the page source. The extra meta description was gone, leaving only the one generated by RankMath.
Re-Crawling and Verifying
To ensure the fix worked, I:
- Cleared my site’s cache.
- Re-crawled affected pages using an SEO audit tool.
- Verified that the duplicate meta description issue was resolved.
Most pages were fixed immediately. If you still see duplicate tags, double-check your caching settings or other plugins that might conflict.
How To Remove Duplicate Meta Descriptions
Conclusion
If you’re optimizing your site for SEO with Elementor and the Hello theme, duplicate meta descriptions can be a frustrating roadblock. By overriding the parent theme’s functions in your child theme, you can resolve this issue and ensure your site remains SEO-friendly, even after theme updates.
Have you encountered a similar issue? Let me know in the comments how you fixed it, or feel free to ask questions if you’re still struggling with duplicate meta tags. Let’s optimize our WordPress sites together!
Key Takeaways
- Issue: The Hello theme outputs a meta description tag by default, causing conflicts with SEO plugins.
- Fix: Use a child theme to disable the parent theme’s function without modifying core files.
- Result: Improved SEO with only one meta description per page.
Share this guide with anyone who might be facing similar SEO challenges with WordPress!
2 Responses
Hello Matthew,
Thank you for this. I used it and it works perfectly.
You’re very welcome Jan, glad it helped!