Build Your Own Business Website header image

Community Library Website – Part 49 – Naming Conflicts in Custom Taxonomies

Difficulty Level -

Whoops, you've found some premium content!

Watch the opening clip of this video to preview it,
the full video is available to paid members.

This is the 49th in a series of live lessons on using WordPress and Thesis as a Content Management System (CMS) for a Community Library Website. In this lesson we discuss issues that have arisen in the project due to naming conflicts in taxonomy terms.  Ordinarily WordPress handles this, however when importing data using CSV Importer that process is circumvented.  We also change a taxonomy name.
Community Library Website – Case Study Part 1 – Site Organization
Community Library Website – Case Study Part 2 – Create Custom Post Types
Community Library Website – Case Study Part 3 – Custom Post Type Configuration
Community Library Website – Case Study Part 4 – Custom Taxonomy Decisions – Theory
Community Library Website – Case Study Part 5 – Custom Taxonomy Decisions – Practical Application
Community Library Website – Case Study Part 6 – Incorporating Existing Data Into the Project
Community Library Website – Case Study Part 7 – Creating Hierarchical Custom Taxonomies
Community Library Website – Case Study Part 8 – Creating Non-Hierarchical Custom Taxonomies
Community Library Website – Case Study Part 9 – Creating Custom Post Meta
Community Library Website Case Study – Part 10a – Restore the Database Using BackupBuddy
Community Library Website Case Study- Part 10 – Creating Custom Post Meta – Continued
Community Library Website – Part 11 – Importing Existing Data to the Website
Community Library Website – Part 12 – Prepare Existing Data for import by the CSV Importer plugin
Community Library Website – Part 13 – Import Existing Data Using the CSV Importer Plugin
Community Library Website – Case Study Part 14 – Date in Permalink Configuration
Community Library Website – Part 15 – Importing Images
Community Library Website – Part 16b – Final Data Import
Community Library Website – Part 17 – Add Thesis Post Meta to Custom Post Type
Community Library Website – Part 18 – Add WordPress 3.0 Menus
Community Library Website – Part 19 – Add Post Meta and Taxonomy Information to the Post Display
Community Library – Part 20 – Add topics and audience to book display
Community Library – Part 21 – Display the Rest of the Post Meta in the Post
Community Library Website – Part 22, Create the Permalink Structure
Community Library – Part 23 – Remove Custom Post Meta from Post Display
Community Library Website – Part 24, Add Taxonomy and Post Meta Data to the Teaser
Community Library Website – Part 25, Add Taxonomy Data to the Teaser
Community Library Website – Part 26, Adjust the Teaser Styling Using Design Options
Community Library Website – Part 27, Styling the Teaser Using CSS
Community Library Website – Part 28 – Fine Tune the Teaser Display
Community Library Website – Part 29, Designing a Custom Catalog Page
Community Library Website – Part 30, Using a Query String in a URL
Community Library Website – Part 31, Adding Custom WordPress Menus
Community Library Website – Part 32, Add Custom Menus to the Catalog Page
Community Library Website – Part 33, Add Another Custom Menu to the Catalog Page
Community Library Website – Part 34, Troubleshooting Custom Menus
Community Library Website – Part 35, Add Styling to WordPress Menus
Community Library Website – Part 36, Add HTML Markup to WordPress Menus
Community Library Website – Part 37, Add WordPress Menus to Archive Pages
Community Library Website – Part 38, Add and Style a List of Tags
Community Library Website – Part 39, Add a Search Box to the Sidebar
Community Library Website – Part 40, Add Links to the Sidebar
Community Library Website – Part 41, Add Taxonomy Drill Down Browsing
Community Library Website – Part 42, Custom Loop to Display Custom Post Types
Community Library Website – Part 43, Simple Custom Query
Community Library Website – Part 44, Custom Taxonomy Query
Community Library Website – Part 45, Add Thesis HTML Structure to Teasers
Community Library Website – Part 46, Display Posts from the Last 60 Days
Community Library Website – Part 47, Custom Loop If Have Posts
Community Library Case Study – Part 48, Increase the Number of Posts that Display on the Custom Catalog
Community Library Website – Part 49 – Naming Conflicts in Custom Taxonomies
Community Library Website – Part 50 – Find and Replace Semi-colons in the Database
Community Library Website – Part 51 – Modify Taxonomy Names Directly in the Database
Community Library Website – Part 52 – Sort Posts by Meta Value
Community Library Website – Part 53 – Show the Term Label Only when a Term Exists
Community Library Website – Part 54 – Sort Archive Posts by Meta Value
Community Library Website – Part 55 – Add Sort Order to Custom Taxonomy

Video Transcript

If you can believe it, this is our 49th episode if you will, or 49th part of our Community Library Website and what I wanted to do in that section is talk a little bit about naming conflicts. One of the things that Pam and I discovered in trying to troubleshoot some data import issues is the importance of unique names in categories and in tags and custom taxonomies. Now WordPress has this nice, little built-in feature whereby if you try to create a duplicate tag or a duplicated named taxonomy term, it will automatically add a number to that. And so, we can see this in my Live Answer topics. If we go over to the dashboard and we look at Live Answer topics, we scroll down here. You can see auto responder has a dash 2 added to it and background images has a dash 2 added to it. That’s because someplace else and it’s probably in my tags, would be my guess, but someplace else, there is another taxonomy term with the term background images. And so, when you create one by adding a new topic, what happens is WordPress automatically makes the name unique.

So let’s go look at tags just real quick and see if that’s really where it is. Tags, post tags… yeah, there’s auto responder. So we already have a post tag called auto responder so you can’t have another taxonomy name term with auto responder so it’s going to have to be auto responder 2 or 3 or 4 or however many. And WordPress does that automatically when you do Add New. The problem arises when you import and when you use the CSV Importer and you’re no longer using the WordPress function for creating these tags or these taxonomy terms, now what you’re doing is you are bypassing that process and you’re adding your own taxonomy terms using you know, my SQL function in that plugin. And so, it’s not smart enough to check for those things and fix them and so, what it can’t do is produce… what it can do is produce a duplicate term which then causes problems.

See Pam asks, “I think WordPress will be smarter if it asked you if you already have the tag auto responder, do you want to choose a unique name?” You know, I suppose that might be helpful. What you can do though is when you are creating it, when you look at the slug because that’s what this is. This is a slug. When you look at the slug, you’ll see that it’s got that number in it and that can be your clue to changing the name. But yeah, I suppose it would be nice if there was a little bit more of that available to you. Nevertheless, we end up with this potential for creating a duplicate taxonomy terms that will cause us problems.

And so, you need to be aware of that when you are creating these taxonomies and these taxonomy terms because this can be an issue. And we’re going to fix that issue in the Community Library Case Study here right now where I have created a custom taxonomy called authors which in fact, is very close to… I’ve given it a name called author and that is the exact name of another taxonomy that’s created by WordPress. And WordPress doesn’t catch the fact that we have created 2 taxonomies with the name of author because it’s not a taxonomy term. It’s actually a taxonomy.

And so… actually, hang on just a second. Somebody suggests that they don’t have any audio. It seems like other people do have audio so yeah, okay. Other people do have audio so Mike, you have a little thing…I’m going to show… actually, I don’t know if this is going to be visible or not. Somebody tell me whether or not they can see my screen, my little on-air showing screen thing, my GoTo Webinar? Okay, got it fixed. Good.

Okay, back to this. So anyway, what we’re going to do is we’re going to change this name from author to item author. So we’re just going to use edit and taxonomy name. Instead of author, it’s going to be item-author. So save the custom taxonomy and now, all of our things are called item-authors and as you may in fact, anticipate here, we are going to need to change some of our code in the custom functions php file in order for us to make this work. But nevertheless…

So anyway, what you want to do is you want to keep… you want to think about that. So for example, we did think about that a little bit early on when we said media type instead of just media. But it didn’t stick well enough for me to catch it with item author. And this can be a problem for example, if you have categories with these same names. You know, you may have created… in fact, that was a problem that we ran into was we ran into a problem where we had categories with the same names as our taxonomy terms. And so, when we went to import the data using the CSV Importer, it broke because we already had a taxonomy term with that term name. So pay attention to term names. Make that they are unique. Make sure that your taxonomy names are unique and don’t make the same mistake that I’ve already made in the presentation here.

0 Comments… add one

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
THIS IS A LIMITED TIME OFFER!
Subscription Options
0 comments… add one

Leave a Comment