/    Sign up×
Community /Pin to ProfileBookmark

Canonical Tags – Javascript

Hey Guys,
Would it be possible to use javascript to place canonical tags on each on of my pages, to save me adding them all individually?

Kind Regards
Paul

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@paulmozzieauthorJun 20.2011 — I mean an dynamic / automatic canonical tag to save me writing an indiv one for each 100+ pages
Copy linkTweet thisAlerts:
@JMRKERJun 20.2011 — I mean an dynamic / automatic canonical tag to save me writing an indiv one for each 100+ pages[/QUOTE]

What is a cononical tag?

Can you give an example?
Copy linkTweet thisAlerts:
@omnicityJun 21.2011 — Yes, and no.

You can use JavaScript to add this to a page after it had loaded, but that means that the main search engines will never see it, which probably defeats the purpose of it...
Copy linkTweet thisAlerts:
@JMRKERJun 21.2011 — What is a cononical tag?

Can you give an example?[/QUOTE]


Yes, and no.

You can use JavaScript to add this to a page after it had loaded, but that means that the main search engines will never see it, which probably defeats the purpose of it...[/QUOTE]


?

Yes, and No ... What does that mean?

What is the "this" that you are adding to a page?

:eek:
Copy linkTweet thisAlerts:
@savvykmsJun 21.2011 — example taken from http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html:
[code=html]<link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish" />[/code]

Sounds like using server-side technology would help you a lot more; most web crawlers do not support javascript, thus it will in all probably work with very few search engines. You could, however, write a Perl script or something similar to walk through a list of files and add in the tag manually.
Copy linkTweet thisAlerts:
@paulmozzieauthorAug 08.2011 — example taken from http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html:
[code=html]<link rel="canonical" href="http://www.example.com/product.php?item=swedish-fish" />[/code]

Sounds like using server-side technology would help you a lot more; most web crawlers do not support javascript, thus it will in all probably work with very few search engines. You could, however, write a Perl script or something similar to walk through a list of files and add in the tag manually.[/QUOTE]


Thank you, so reading through these threads it is possible to create an automated canonical tag but they might not work?
Copy linkTweet thisAlerts:
@JMRKERAug 08.2011 — Thank you, so reading through these threads it is possible to create an automated canonical tag but they might not work?[/QUOTE]

:confused:
Yes, and No ... What does that mean?

What is the "this" that you are adding to a page?

:eek:[/QUOTE]

I find it difficult to determine if I can help when you ask questions, but don't respond to ours. :rolleyes:

The links posted also are broken. :eek:
×

Success!

Help @paulmozzie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...