• I am trying to create post tags using a combination of pre-existing custom field values. For example, let’s say I have two custom fields I want to use:

    Custom Field 1: City Name
    Custom Field 2: State

    And what I’d like to do is use SQL to add a [city][state] post tag to all posts where those fields have been defined.

    I’m entirely unsure of how to do this:)

    Any help you could provide would be very much appreciated.

Viewing 1 replies (of 1 total)
  • I think this would be very difficult, if not impossible, to do with SQL due to the need to generate proper slugs for the terms.

    Even if that can be done, the need to add rows to 3 tables where the id from the terms table is used in the term_taxonomy table and the taxonomy id from the term_taxonomy table is used in the term_relationships table along with the post ID from the postmeta table, makes this a very tricky SQL problem.

    It can probably be accomplished with PHP, but would be a fair sized programming problem.

Viewing 1 replies (of 1 total)

The topic ‘Creating tags from custom fields?’ is closed to new replies.