I Hate Quick Questions

Computer related issues and really random ones

  • Bootstrap
  • Tools
    • WordPress Minify Content
  • iPhone
  • Jailbreak
    • Evasi0n
  • PhP
  • Slow Computer
  • Storage
  • PC to Mac
  • Fix UTF8 Converter

How To Capitalize Categories In WordPress With php/mySQL

October 6, 2013 / Leave a Comment

WordPress-512x512

So I am a huge WordPress fan and I tend to modify my sites with massive custom code and pimp them out. One thing I have noticed is there was not a ton of information out there about capitalizing categories in WordPress. My guess is that most people will do that anyways as they create categories, but for those of us you love to syndicate content and allow categories to be populated automatically this can cause lowercase categories to be produced.

Since I am a huge php/mysql fan I love to create scripts that to things for me….automation is a better description of this, and that I am lazy too so I know for my scripts to do things for me.

So here is how you do it

First you are going to want to place the script somewhere on your web server.  Most likely in the root of your directory. If you have no idea what I am talking about then you are going to want to read about FTP and how to upload files to your server manually.

In the root of your web server create a folder called “includes” (technically any name is find, just don’t forget it)

Now place this script in the includes folder and call it “capitalize_categories.php”


Replace $host. $usr, $pwd and $db with the proper credentials from your hosting provider.

Once you have done all this you are all set. Then you can simply go to the url that contains this file and it will run it for you

http://www.example.com/includes/capitalize_categories.php

Remember: if you changed the name of the folder and/or script then you will want to change the url to match that.

How to automate this

Now that you have the script, let’s make this even easier and have it run automatically.

In order to do this you are going to want to setup a cron job with your hosting provider. Again if you have no idea what I am talking about then read this

I would set the script to run once a day or whatever you feel is a safe amount of time to do it. Since I syndicate 20+ articles a day I tend to run mine twice a day. You can do whatever you like.

Hope this helps and leave a comment below if you need some help 🙂

Related Posts

  • Getting Google Analytics Demographic Data To Work With WordPressGetting Google Analytics Demographic Data To Work With WordPress
  • proftpd keeps crashing or just stops working and I don’t know whyproftpd keeps crashing or just stops working and I don’t know why
  • Jailbreak for the iPhone 5 “I’m so confused”Jailbreak for the iPhone 5 “I’m so confused”
  • Top Evasi0n7 Jailbreak Issue “Modifying rootfs…” then crashesTop Evasi0n7 Jailbreak Issue “Modifying rootfs…” then crashes
  • Words with friends cheat – How to cheat your way to the topWords with friends cheat – How to cheat your way to the top
  • How To Define A String The Right Way With PHPHow To Define A String The Right Way With PHP
  • Bacon makes everything betterBacon makes everything better
  • Fried Rat Served To Customer At KFCFried Rat Served To Customer At KFC
Posted in: Everything Tagged: Capitalize, Categories, Wordpress

Some fun side project sites

Scrabble Dictionary – Fun site I made as a joke for a friend.

Seamlessdesk – Help Desk Software I developed

Fix UTF8 Online Converter

Stalk Me

Recent Posts

  • MacOS Mojave installer keeps saying the file is damaged or corrupted, HELP!
  • proftpd keeps crashing or just stops working and I don’t know why
  • How to “For Realz” remotely install profile manager profiles silently with no MDM using Apple Remote Desktop
  • Trade Skill Master – Determining Market Value Region vs. Min BuyOut
  • Upgrade any Macbook Flash Drive even when The Apple Store says You Cant

Copyright © 2023 I Hate Quick Questions.

Me WordPress Theme by themehall.com

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok