question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Meta tags not reset on navigate

See original GitHub issue

I’m hoping to use this plugin to set specific meta data (title, keywords, og: tags etc) on certain pages, but I want it to fallback to the defaults when you navigate to any page that does NOT specify tag data.

The problem is, it doesn’t appear to reset the tags if a user moves to a page that has no overrides.

For example, in my main file I have this:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>My Test App</title>

    <meta name="keywords" content="standard keywords, more keywords" id="keywords" />
    .... etc ....

I have a view “tagged-view” that has this within it:

head: {
    title: { inner: 'My Special Page' },
        meta: [
            { name: 'keywords', content: 'special keywords, different words', id: 'keywords' }
        ]
    },

Note that I’m using the id attribute to do replacement of the tag, and that’s working.

If I go to “/” I see the default title (“My Test App”) and default keywords (“standard keywords, more keywords”).

Then if I click a router link to go to /tagged-view, I can see the title is now “My Special Page | My Test App”, and the keywords have changed to “special keywords, different words”.

However, if I then click a router link to go back to “/” I see that title has changed back to the default (“My Test App”) but the keywords are still showing the customised version (“special keywords, different words’”). It only resets back to the defaults if I do a full page refresh.

So it seems as though the only way to have a deafult is to actually physically set the keywords etc (for ALL my meta tags) on every single page.

Is this a known/intended behaviour, or is there some config I can set to ensure it resets on every navigation?

Thanks 😃

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ktquezcommented, Sep 25, 2020

Hey @bronthulke, sorry for the delay. I managed to see the error.

I will do some tests, and soon as done I give you feedback here with the solution or a new fixed version.

0reactions
bronthulkecommented, May 21, 2021

Hey @ktquez, it’s still an issue and unfortunately I haven’t even had a chance to dig in any deeper myself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery - Using javascript to reset the meta tag to prevent it from ...
I don't think there's a way to stop the meta refresh. You can change the meta tag, but the browser has already decided...
Read more >
Meta Tags and Attributes that Google Supports | Documentation
Google supports both page-level meta tags and tag attributes. Explore a list of the special tags that Google Search can support.
Read more >
Rank Math 'Titles and Meta' Options and Settings
In this knowledgebase article, we are going to cover Rank Math's Title and Meta settings. As you probably know, the titles and meta...
Read more >
How to View Metatags on a Website
1. Open your browser and navigate to the Web page containing the metatags you wish to view. · 2. Right-click a non-hyperlinked area...
Read more >
Configure a page level meta tag - ServiceNow Docs
Navigate to All > Content Management > Pages. · Open the page. · If not already included, add the Meta Tags related list...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found