WP Manifestindependent plugin directory
manifest / seo / seo-tag-cleaner

SEO Tag Cleaner

Optimizes H1, footer, and header tags for better SEO by managing duplicates.

★ 10stars
1.0.0latest · 1 year ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/hassan7303/seo-tag-cleaner/archive/refs/heads/master.zip
Updates itself. It ships its own updater, so new versions appear under Dashboard → Updates.

Contributors Forks Stargazers MIT License LinkedIn Telegram Instagram GitHub Email Website

SEO Tag Cleaner

Version: 1.1
Author: Your Name
Description: This WordPress plugin optimizes HTML tags for SEO by managing duplicate <h1>, <footer>, and <header> tags on the page.


Features

  • H1 Tag Management:
    Ensures only one <h1> tag exists on a page. Any additional <h1> tags are converted to <h2>.

  • Footer Management:
    Identifies the main <footer> tag based on its content. Additional <footer> tags are replaced with <div> tags.

  • Header Management:
    Identifies the main <header> tag and replaces duplicate <header> tags with <div> tags.

  • Buffering for Full HTML:
    Processes the entire page HTML output to ensure compatibility with all themes and plugins.


Installation

  1. Download the Plugin
    Save the plugin code as seo-tag-cleaner.php.

  2. Upload to WordPress
    Place the file in the following directory: wp-content/plugins/seo-tag-cleaner/

  3. Activate the Plugin
    Log in to your WordPress dashboard, go to Plugins, and activate SEO Tag Cleaner.


How It Works

The plugin intercepts the HTML output using the template_redirect and shutdown hooks. It processes the HTML using DOMDocument to identify and manipulate the following elements:

  1. H1 Tags:
  • Keeps the first <h1> tag.
  • Converts additional <h1> tags to <h2>.
  1. Footer Tags:
  • Determines the main <footer> tag based on its content length.
  • Replaces other <footer> tags with <div>.
  1. Header Tags:
  • Determines the main <header> tag based on its content length.
  • Replaces other <header> tags with <div>.

Customization

Modify Main Element Selection

To change how the main <footer> or <header> tag is determined, update the find_main_element() function. The current implementation uses content length to decide.


Troubleshooting

  • No Changes Visible:
    Ensure your theme outputs standard HTML tags and the content includes the elements (<h1>, <footer>, <header>) to modify.

  • Compatibility Issues:
    If the plugin conflicts with other plugins or customizations, disable it and verify the issue.

Releases

1 release.

Tag
Published
1.0.0 latest
Dec 10, 2024 1 year ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.