be sure to use the article ID specified in the above command as your object_id. note that term_id and term_taxonomy_id are probably similar but different!įor each category or tag you want to assign to the post, create a separate entry in wp_term_relationships. this is your category’s real unique identifier. to find which number to use as “term_taxonomy_id” in the second mysql statement, find the term ID of the desired category in wp_terms, then search for this term_id in wp_term_taxonomy and note the number in term_taxonomy_id. You’ll need the correct ID number for your category or tag. the post category is NOT defined in wp_posts itself (despite there being a field ‘post_category’), but in another table, wp_term_relationships. Now it’s time to assign a category, and possibly also tags, in wp_term_relationships. Step 2: assign at least one category using mysql Here’s an actual example from my own migration: getting the GUID wrong will result in your article being unreachable, even if you link to it using just its ID (e.g. in my script, i used a combination of my post’s name and the article ID (see example below), so i’d be sure it’s definitely unique across the entire wp_posts table. like it can’t have any special characters or double hyphens. “”), any folder structure (such as “/year/month/day”) and a unique article identifier. it’s the complete URL (or ) for your article, including your domain name (e.g. and are, as far as i can tell, just shown in the backend.it can have no special characters or spaces (usually replaced with a hyphen), and it also shouldn’t have any double hyphens (“−−”). is typically a cleaned-up version of your title with only alphanumeric characters and hyphens (“−”)., unsurprisingly, is where your blog title goes.is the main content of your blog article.these timestamps will be used to show when the article was published. and will be your post date and time, first in your timezone and second in GMT, using the format “ 01:23:45”.note this number as you’ll need it for step 2. needs to be a unique number that increases for each entry.Step 1: insert your article into table wp_posts using mysql The very least you’ll need to do in mysql, is create your blog post in wp_posts, and then assign a category in wp_term_relationships:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |