Several users have asked for the ability to remove certain words like “The” and “A”, or even “Le”, “La”, and “Les” from the front of headings in their indexes. While I have already document how you can do that with AZIndex, the solution is not easy for novice WordPress users because it involves adding PHP code to one of your blog’s theme files, and if you accidentally make a mistake when inserting the code, it’s all too easy to crash your entire blog!
So I thought that there has to be a better, safer way to do this… and there is!
The main problem of adding new code to your blog is that it all too easily be overwritten or deleted when you upgrade. If you add it to an plugin directory, it will be deleted when you install the next plugin upgrade, and if you add it to the WordPress base, it may disappear the next time you move up to the latest level of WordPress. Even if you add it to your theme, you have to worry about replacing the code if you decide to upgrade or switch themes. There are not many safe places for your code.
However, there is one—inside its own plugin. While plugins like AZIndex and WP Super Cache are large, complex chunks of code that greatly enhance your blog’s operation, there is no reason why a plugin can’t be just a few lines of code that does something useful. In fact, the other WordPress plugin I wrote, TinyMCE Entities Patch Plugin, (now defunct) is only ten lines of code long.
Therefore there are four major reasons why adding extra code to your blog as another plugin is a great idea, even if you’re not really writing a full-blown plugin:
- It is safe from being overwritten when you upgrade other parts of your blog.
- You can activate and deactivate the code from your blog’s Plugin Management page as often as you want.
- You can also edit the source code for the plugin directly from the Plugin Management page.
- (and this is a big one) If you make a serious mistake when you add your code to the plugin, WordPress will detect the problem and immediately deactivate the plugin thus protecting your blog from a bad crash.
Therefore I will soon be offering for download, from this site, the AZIndex User Extensions plugin. This plugin will be different from AZIndex in the following ways:
- It is designed to run with AZIndex and requires the AZIndex plugin to be installed and activated on your blog.
- It will not be available from the online WordPress Plugin Directory. You will only be able to get it from this site.
- Unlike AZIndex (and other plugins), you will be encouraged to tailor the functionality of the plugin by directly editing the code in the plugin file. (Note: you will probably need to know at least a little bit of PHP to do this, but not much.)
- There will be no automatic upgrades for this plugin because they would overwrite any changes you make. So the version number for this plugin will always be “1.0”.
- I will probably be making more than one AZIndex User Extensions plugin available, containing different functions. The first one will be for filtering out words from the front of index headings (as mentioned above), but there will be others that provide, for example, alternative comparison functions that allow you to sort your index in different ways.
The next post on this blog will present the first extensions plugin containing the filtering code people have been requesting. Stay tuned.