joomla 1.7 – iJoomla Blog https://www.ijoomla.com/blog iJoomla Blog Fri, 14 Apr 2023 08:50:44 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.4 Keeping your Joomla code tidy https://www.ijoomla.com/blog/keeping-your-joomla-code-tidy/ https://www.ijoomla.com/blog/keeping-your-joomla-code-tidy/#comments Mon, 13 Feb 2012 13:44:04 +0000 http://www.ijoomla.com/blog/?p=1268 clean joomla codeThere is more to running a Joomla site then picking out a template, installing a few plugins and releasing it to the world. Is your code neat and legible? Is your site prepped for SEO? Are you loading javascript libraries more than once? In your site executing unnecessary code? Chances are high that there is plenty of fat to be trimmed from your site. Let’s look at some of the bigger issues you might have.

remove meta generator

Too much meta info

Open up your website, right click, and view your source code. Look for the “meta name” lines.


meta name="keywords" content="keyword, another keyword, more keywords"


meta name="description" content="This is your meta description field. It will be made up of 156 or less characters and will be what you see in Google search results so make it perfect."


These are the most important meta tags you can have on your site. They must be different for every page on your site, they must not include your site name, and they need to be skillfully written to include keywords representing what your single webpage is about. If you use the same meta description for every single page, Google might not rank you properly or can potentially penalize you. Proper SEO is a whole other topic we will talk about in the future. If you want some quick tips and solutions for SEO in your Joomla site, try out our SEO extension. Now, let’s get back to meta tags.
Joomla loves adding additional meta information. Every single Joomla install you do will have this tag automatically added to your site.


meta name="generator" content="Joomla! 1.5 - Open Source Content Management"


This is a largely useless tag, used mostly to advertise Joomla. You can remove it by using a plugin or by adding a small bit of code to your site. You can read about how do do that in this blog post.
There are about a million different meta tags you can use in a website. Make sure to use only the ones you absolutely need, and if you aren’t using one, take it out. Do you want an easy way to edit all your Joomla meta tags at once? Try our extension.

Keeping your < head > clear

The < head > element of your source code is the place where a lot of stuff is going on. You will see meta information, references to css, stylesheets, javascript files, Google tracking code and a variety of other things beyond the scope of this article. This area can quickly get bloated and out of control. If your < head > area has 500 lines of code inside of it, you are doing something wrong. Webpages will load slower, Google will have more troubles scanning and indexing your site, and compliance will most likely be shot as well. Try to keep things tidy, and having a solid understanding of what is in the < head > area of your website is infinitely valuable.

Too much bling

When building a website it is easy to get caught up in fancy sliders and widgets and tabs and lightboxes and flippy things. They look pretty, and in many cases help display content on your site. The down side is code bloat. Look at this example:




What is wrong here?

Lines 1,2,3,4,5 and 6 are all calling some sort of javascript. The problem is 1,2,& 3 are calling the same code but in different locations. This means every single time you load your website, you are executing 3 identical chunks of code. This will make a massive impact on your page load speed, as well as potentially conflict with your website, preventing your fancy effects from even working.

What else is wrong?

You can also see in this example that jquery is being loaded two times at once. Frequently jQuery and MooTools will conflict with each other causing all sorts of headaches. When possible, try to stick with one form of javascript or the other. Running both on your site is code bloat. When looking for extensions, try to make sure you always use the same library. It will be better for you in the long run.

Do you have any tips or pet peeves?

These are some of my pet peeves for a clean Joomla site. What do you do to keep your site clean, fast and efficient?

]]>
https://www.ijoomla.com/blog/keeping-your-joomla-code-tidy/feed/ 1
Remove the Joomla meta name generator tag https://www.ijoomla.com/blog/remove-joomla-meta-name-generator-plugin/ https://www.ijoomla.com/blog/remove-joomla-meta-name-generator-plugin/#comments Thu, 09 Feb 2012 16:39:10 +0000 http://www.ijoomla.com/blog/?p=1233 remove joomla meta generator

Do you want to remove the meta tag “generator” from your Joomla site?  It’s very easy to do.


In this post I will show you how to do it with a plugin, and also how to do it with a single line of code.

Why do I want to remove it?

Ideally you do not want large amonts of unnecessary code in your website. You do not want to make it harder for Google and search engines to find what they need–you want to make it easier. Now I understand, this one line of code isn’t exactly a ton of bloat, but it all adds up over time. A bit of code here, an extra meta there, and all of a sudden you have a huge index file that takes ages to load. Keep things tidy.

remove meta generator

Give me a plugin.  Code scares me.

By far the easiest way is to use the Joomla plugin ByeByeGenerator.  Install the plugin, enable it, verify the meta tag is removed in the source code and you are done.  Not only is the method the easiest, it will work for any version of Joomla.  1.5, 1.6, 1.7 & 2.5.  This method is also persistent, so if you change your templates a lot or do any updates, this plugin will always work and never get overridden.  But what if you are a purist?

enabled joomla plugin

I don’t want another plugin, just tell me how to do it manually

The method to removing the meta name generator tag for Joomla varies between versions.  On Joomla 2.5 you can simply add this code to your index.php file in your template.

JFactory::getDocument()->setGenerator('');

Put it just after the line //no direct access.  This method will vary greatly on what template you are using and from what company, so I cannot get too detailed.  For example YooThemes has a different template structure then RocketThemes.  You will have to noodle around a bit yourself in order to do this.  The main advantage of editing the template code instead of installing a plugin is less overhead.  The fewer plugins you have, the faster your site will be, and queries add up fast.

Conclusion

This is one of the few cases I’d suggest using a plugin over editing code.  This plugin totally removes the meta name generator tag, installs in no time at all and get’s the job done.  I use this plugin personally for the Joomla sites I build.  I heartily recommend it.

]]>
https://www.ijoomla.com/blog/remove-joomla-meta-name-generator-plugin/feed/ 10