Meta Tags and Keywords always the same

Joomla version 1.0 is end-of-life and are no longer supported. Please use Joomla 3.x instead.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
bananaman
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Oct 16, 2005 11:04 am

Meta Tags and Keywords always the same

Post by bananaman » Tue Feb 21, 2006 9:48 pm

Im runing Joomla 1.0.7 but its basic is Mambo 4.5.2 (it was upgraded by overwriting with 1.0.1). , I read somwhere there was a problem that somwhere in code was an error so its always showing basic keywords and description, ones you set in global config, no metter what page you are on, please this means very much to me.

Web page is
http://www.gotocro.com

Many thanks for help  :)
Last edited by Tonie on Wed Mar 15, 2006 12:06 pm, edited 1 time in total.

 
User avatar
Nic
Joomla! Guru
Joomla! Guru
Posts: 618
Joined: Fri Aug 19, 2005 3:36 pm
Contact:

Re: Meta Tags and Keywords always the same

Post by Nic » Tue Feb 21, 2006 10:04 pm

I haven't heard about this bug - which does not mean it hasn't been there, no clue really - but I can assure you that in 1.0.7 the meta tag functionality as implemented and intended is fully functioning. It is easy to test: edit an article and enter some item specific meta keywords and description. If you check the source code of that html page you will see that they have been appended to the site's global meta keywords/description.

If you are interested in content related meta tags you might be interested in these links:

- Meta-Tag Generator
  (a very nice hack that adds a "generate meta tags" button to the article's editing page, which will automatically suggest usefull keywords/description using the article's content)
- MetaFly mambot
  (a smart mambot that will create those content related meta tags automatically)

Hope this helps.

Nic

bananaman
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Oct 16, 2005 11:04 am

Re: Meta Tags and Keywords always the same

Post by bananaman » Tue Feb 21, 2006 10:21 pm

Thanks on fast reply but as I said Meta tag generator is already implemented :( and on all pages Im getting the same meta tags :(

Once more thanks on such quick reply but it seems I will need to search further

Thanks

B

User avatar
DeanMarshall
Joomla! Hero
Joomla! Hero
Posts: 2352
Joined: Fri Aug 19, 2005 2:26 am
Location: Lancaster, Lancashire, United Kingdom
Contact:

Re: Meta Tags and Keywords always the same

Post by DeanMarshall » Wed Feb 22, 2006 12:21 am

Hi,

I think you have more pressing issues to be honest. On first visit your site is painfully slow - so I thought i would see why.
http://www.websiteoptimization.com/serv ... tocro.com/

Apart from the fact that the page is over 300KB in size

Total HTTP Requests: 49
Total Size: 322705 bytes

and that the download time is:
56K  65.11 seconds

you have a few missing elements that are redirected back onto new instances of the script - scaling your database load by about 400%

The clue is here:
1  13191  CSS IMG  http://www.gotocro.com/templates/gotocr ... ullet1.gif
1 13185 CSS http://www.gotocro.com/css/com_estilos.css
1 13183 CSS IMG http://www.gotocro.com/templates/gotocr ... search.gif
1 13182 CSS http://www.gotocro.com/css/template_css.css
1 13178 HTML http://www.gotocro.com/

Notice all those files that are within a few bytes of the size of the HTML - those are the missing files being redirected to a new instance of the script.

The solution is to amend your .htaccess file to prevent this cycling.
There is a new solution available somewhere in the forums - but the .htaccess supplied with Joomla has a 'solution' that works for many.

The first line is the key - when added immediately above the other lines - it should stop the script from being called when files with those prefixes are missing: Add the line and try and load one of the missing files in your browser - you should see a 404 file not found error rather than seeing your site.

Code: Select all

RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|gif|png|css|js|pl|txt|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
Of course the size of your flash and other graphics is also problematic.
23KB is very large for the 'small' left3 and right3 graphics.

Hope that gives you some pointers.

Dean.
Dean Marshall Consultancy - six Joomla experts - http://www.deanmarshall.co.uk/

Joomla Experts - Joomla Support http://www.deanmarshall.co.uk/joomla-se ... pport.html

bananaman
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Oct 16, 2005 11:04 am

Re: Meta Tags and Keywords always the same

Post by bananaman » Tue Mar 14, 2006 5:31 pm

Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords

User avatar
Nic
Joomla! Guru
Joomla! Guru
Posts: 618
Joined: Fri Aug 19, 2005 3:36 pm
Contact:

Re: Meta Tags and Keywords always the same

Post by Nic » Wed Mar 15, 2006 12:23 am

bananaman wrote: Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords
If you want to reverse your meta tag order from "site meta - content meta" to "content meta - site meta" you simply need to change one line in file includes/joomla.php (backup first!):

Search for this line:

Code: Select all

$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];
and change it to:

Code: Select all

$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '. $content;
Or if you want only content meta on content items (i.e. no site meta is displayed on content items) change that line to this instead:

Code: Select all

$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1];
Hope this helps.

Nic

bananaman
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Oct 16, 2005 11:04 am

Re: Meta Tags and Keywords always the same

Post by bananaman » Wed Mar 15, 2006 11:13 am

Thank you so much on your quick reply, I solved the problem differently but this solution is also great, I found on mamboserver one old post and used code from there to fill global tags when there are none generated for the page, and if the page has its own meta tags then to use its own, without using global. This is the code and files I edited:

in /includes/joomla.php after function appendMetaTag I have added

Code: Select all

function addIfEmptyMetaTag( $name, $content ) {
                $name = trim( htmlspecialchars( $name ) );
                $n = count( $this->_head['meta'] );
                for ($i = 0; $i < $n; $i++) {
                        if ($this->_head['meta'][$i][0] == $name) {
                                $content = trim( htmlspecialchars( $content ) );
                                if ( $content ) {
                                        if ( !$this->_head['meta'][$i][1] ) {
                                                $this->_head['meta'][$i][1] = $content ;
                                        } else {
                                                return;
                                        }
                                }
                                return;
                        }
                }
                $this->addMetaTag( $name , $content );
       }
and changed in /includes/frontend.php

$mainframe->appendMetaTag( '...

to:

$mainframe->addIfEmptyMetaTag( '...

This is exactly what I needed, but your solution would also do.

Many thanks once more :)

cmeinck
Joomla! Intern
Joomla! Intern
Posts: 58
Joined: Tue Apr 04, 2006 10:58 pm

Re: Meta Tags and Keywords always the same

Post by cmeinck » Tue Apr 25, 2006 11:15 pm

Nic-
Thanks for this post. I had this modification done in Mambo, but lost it in the conversion to Joomla.

Excellent. Thanks!

Chris

Jack Squat
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat May 13, 2006 8:00 pm
Contact:

Re: Meta Tags and Keywords always the same

Post by Jack Squat » Sat May 13, 2006 8:18 pm

Nic wrote:
bananaman wrote: Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords
If you want to reverse your meta tag order from "site meta - content meta" to "content meta - site meta" you simply need to change one line in file includes/joomla.php (backup first!):

Search for this line:

Code: Select all

$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];
and change it to:

Code: Select all

$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '. $content;
Or if you want only content meta on content items (i.e. no site meta is displayed on content items) change that line to this instead:

Code: Select all

$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1];
Hope this helps.

Nic
i have tried this method and show no change in the order of my meta tags.
do i need to change anything other than that code mentioned above?

thanks
JS

Jack Squat
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat May 13, 2006 8:00 pm
Contact:

Re: Meta Tags and Keywords always the same

Post by Jack Squat » Sat May 13, 2006 8:22 pm

one more question
not only would i like to change the order but i would also like to use a keyword phrase
instead of the site name, is this possible?

thanks again
JS

pippolo
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Sun Nov 27, 2005 2:46 am

Re: Meta Tags and Keywords always the same

Post by pippolo » Thu May 18, 2006 11:11 pm

bananaman wrote: Thank you so much on your quick reply, I solved the problem differently but this solution is also great, I found on mamboserver one old post and used code from there to fill global tags when there are none generated for the page, and if the page has its own meta tags then to use its own, without using global. This is the code and files I edited:

in /includes/joomla.php after function appendMetaTag I have added

Code: Select all

function addIfEmptyMetaTag( $name, $content ) {
                $name = trim( htmlspecialchars( $name ) );
                $n = count( $this->_head['meta'] );
                for ($i = 0; $i < $n; $i++) {
                        if ($this->_head['meta'][$i][0] == $name) {
                                $content = trim( htmlspecialchars( $content ) );
                                if ( $content ) {
                                        if ( !$this->_head['meta'][$i][1] ) {
                                                $this->_head['meta'][$i][1] = $content ;
                                        } else {
                                                return;
                                        }
                                }
                                return;
                        }
                }
                $this->addMetaTag( $name , $content );
       }
and changed in /includes/frontend.php

$mainframe->appendMetaTag( '...

to:

$mainframe->addIfEmptyMetaTag( '...

This is exactly what I needed, but your solution would also do.

Many thanks once more :)

I use metafly and this hack, all works greatful about contents but I would use this option with other components too, I think it could be so useful...is it possible?
How to do it?

User avatar
allado
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Mon Mar 06, 2006 10:26 pm
Location: Rosario
Contact:

Re: Meta Tags and Keywords always the same

Post by allado » Sun Dec 23, 2007 3:23 pm

Nic wrote:
bananaman wrote: Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords
If you want to reverse your meta tag order from "site meta - content meta" to "content meta - site meta" you simply need to change one line in file includes/joomla.php (backup first!):

Search for this line:

Code: Select all

$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];
and change it to:

Code: Select all

$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '. $content;
Or if you want only content meta on content items (i.e. no site meta is displayed on content items) change that line to this instead:

Code: Select all

$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1];
Hope this helps.

Nic
Very Thanks NIC... this post is very helpfull, thanks

yi9bo2006
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Mon Mar 30, 2009 5:04 am

Re: Meta Tags and Keywords always the same

Post by yi9bo2006 » Sat Apr 11, 2009 9:39 am

Thanks very much, Nic, that's exactly what I need. Got it. Great. I think, it will be more useful for SEO
Nic wrote:
bananaman wrote: Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords
If you want to reverse your meta tag order from "site meta - content meta" to "content meta - site meta" you simply need to change one line in file includes/joomla.php (backup first!):

Search for this line:

Code: Select all

$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];
and change it to:

Code: Select all

$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '. $content;
Or if you want only content meta on content items (i.e. no site meta is displayed on content items) change that line to this instead:

Code: Select all

$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1];
Hope this helps.

Nic

dharmaraajanv
Joomla! Intern
Joomla! Intern
Posts: 66
Joined: Wed Sep 02, 2009 10:36 am
Contact:

Re: Meta Tags and Keywords always the same

Post by dharmaraajanv » Thu Sep 03, 2009 11:11 am

Hi,

It's Very simple way to display customize Meta Tags and Keywords ...

This concept will wont work if the content are coming from article ..
This for Joomla1.5.X
$document =& JFactory::getDocument();
$document->setTitle($document->getTitle() . ' | ' . "Webmaker");
$document->setMetaData("keywords", "Webmaker,web developer, css designer, cd presentation,logo designer");
$document->setDescription("Webmaker is the website developer whoe makes and create website static ,dynamic");
$document->setGenerator("This is Generated by Webmaker.co.in");


Hope this helps.

User avatar
myrunet
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Jul 10, 2010 2:27 pm
Location: Canada
Contact:

Re: Meta Tags and Keywords always the same

Post by myrunet » Thu Nov 18, 2010 5:49 am

Hi I have the same proble I need to update or overwrite legacy global configuration to have each page show its own content mata tag, I'm new with making changes to files and mention above files fo not have those codes includes/joomla.php can somone make changes to apply those settings, so far when I add a link on facebook it only shows global meta tags in all pages the same although photos in those pages appear different. www.360canada.com

toffer24
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Sep 26, 2011 2:16 pm

Re: Meta Tags and Keywords always the same

Post by toffer24 » Mon Sep 26, 2011 2:32 pm

Hi, pardon my English.

...so I went to site->global configuration and filled up the following portions: Site Name, Global Site Meta Description, and Global Site Meta Keywords then save. I went to my site's page source and the found out that the keywords and description I've placed in the global configuration does not reflect as it is.

The keyword and description are being taken from the page content. So basically, the keyword and description for the home page is totally different to the other page. And the keyword and description is normally from the article/content of the page. It automatically generates.

What I'd like to do is to have my homepage keyword the same for the entire web pages.

I spent a day reading and looking for the answer but never got lucky to have the answer.

This is my site http://www.greenmyfleet.com/

All responses are highly appreciated.

Thanks,
toffer24

 

Locked

Return to “Upgrading - 1.0.x”