glennwill
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: How to use slashes in page URL?Yes, it is possible to change the URL structure of your website to make it more structured and easier to understand. One way to do this would be to use WordPress’ built-in permalink settings to change the structure of your URLs. You can find this setting by going to Settings > Permalinks in your WordPress dashboard. From there, you can select the “Custom Structure” option and enter the desired structure, such as /%category%/%postname%/.
It’s important to note that changing the URL structure of your website can have an impact on your search engine rankings, so it’s best to do it carefully and make sure to redirect all the old URLs to the new ones.
Yeah that works perfectly.
Thank you very much to all who participate in this support forum.
Hi David,
Now I have added the below code in functions.php but tags only show up on homepage, not on the alternate post.
function add_hreflang_tags() { if (is_front_page() || is_home()) { echo '<link rel="alternate" hreflang="hi-IN" href="https://hindivarnamala.in/" /> <link rel="alternate" hreflang="en-IN" href="https://hindivarnamala.in/hindi-alphabet-letters/" />'; } if (is_page('hindi-alphabet-letters')) { echo '<link rel="alternate" hreflang="hi-IN" href="https://hindivarnamala.in/" /> <link rel="alternate" hreflang="en-IN" href="https://hindivarnamala.in/hindi-alphabet-letters/" />'; } } add_action('wp_head', 'add_hreflang_tags');But it does not show up here when I check view-source page
Can you let me know please how you can see that and what codes you’re using?
Hi David,
The english post is written manually not translated
Yeah I have re-added but does not work
Hi fernandoazarcon2,
No this plugin https://wordpress.org/plugins/insert-headers-and-footers/ does not work at all for specific post or pages. It will display the tags in header for all posts & pages.
Anyone can help me to place the mentioned tags via code in the <head> section for the above mentioned URLs?
Yes I only want to add the below tags in the <head> section for both URLs:
<link rel="alternate" href="https://hindivarnamala.in/" hreflang="hi-IN" /> <link rel="alternate" href="https://hindivarnamala.in/hindi-alphabet-letters/" hreflang="en-IN" />Sure,
These are 2 URLs with same content but with different language:
https://hindivarnamala.in/hindi-alphabet-letters/
Please help me to add the below tags in <head> section for both URLs:
<link rel="alternate" href="https://hindivarnamala.in/" hreflang="hi-IN" /> <link rel="alternate" href="https://hindivarnamala.in/hindi-alphabet-letters/" hreflang="en-IN" />Your help will be highly appreciated. π
I have used the below code in funcstions.php but it does not work:
function add_hreflang_tags() { if (is_front_page() || is_home()) { echo '<link rel="alternate" hreflang="hi-IN" href="https://example.in/" />'; } if (is_page('hindi-alphabet-letters')) { echo '<link rel="alternate" hreflang="en-IN" href="https://example.in/hindi-alphabet-letters/" />'; } } add_action('wp_head', 'add_hreflang_tags');- This reply was modified 3 years, 3 months ago by glennwill.