Description
Hamzaban is a plugin that helps you add and manage hreflang tags for your WordPress site. Hreflang tags are essential for SEO, especially for multilingual sites, as they tell search engines which language and regional URLs to serve to users based on their location and language preferences.
Features
- Add hreflang tags to posts, pages, and custom post types.
- Manage hreflang tags through a simple meta box in the post editor.
- Display hreflang links in your theme’s navigation menu.
- Option to enable or disable the display of hreflang links in the navigation menu through the plugin settings.
Usage
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Go to the post or page editor, and you will see a meta box to add hreflang URLs and languages.
- Done! hreflang metatag will be added to your website pages head.
- You can use the provided function or template tag to display the hreflang links in your theme.
Display Hreflang Links in Theme
To display the en
language URL in your theme, use the following code:
`php
<?php
if ($hreflang = array_filter(get_post_meta(get_the_ID(), '_hamzaban_post_langs', true), function($lang) { return $lang['lang'] === 'en'; })) {
$hreflang = reset($hreflang); // Get the first match
echo '‘ . __(‘English Version’, ‘hamzaban’) . ‘‘;
}
?>
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Hamzaban – Hreflang Tag Generator for WordPress” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Hamzaban – Hreflang Tag Generator for WordPress” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.