Install
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.zipSEO 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
-
Download the Plugin
Save the plugin code asseo-tag-cleaner.php. -
Upload to WordPress
Place the file in the following directory: wp-content/plugins/seo-tag-cleaner/ -
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:
- H1 Tags:
- Keeps the first
<h1>tag. - Converts additional
<h1>tags to<h2>.
- Footer Tags:
- Determines the main
<footer>tag based on its content length. - Replaces other
<footer>tags with<div>.
- 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.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.