Migrating old posts to new wp, how to extrapolate infos from the post body to custom fields?

The short answer is that you Loop over all of you posts and use (probably) preg_match to extract information. The long answer is that this could be pretty tricky, depending on how consistent your data entry is. Here is an example: global $wpdb; $sql = “SELECT ID,post_content FROM {$wpdb->posts}”; $allp = $wpdb->get_results($sql); foreach ($allp as … Read more

Custom Metabox additional item

Your above code should be working as is. There is however one logical error at the end of your saving function – you make the saving of both fields dependent on whether $_POST[‘_url’] is set. I suppose that is not intentional. You likely want something along the lines of: if ( isset( $_POST[‘_url’] ) ) … Read more

Multiple URLS per post non-ascii

Add a new field below the post title and use something like my transliteration table to convert the post slug to US-ASCII. Then save that new slug in a meta field. Hook into 404_template (example), and run a meta query for the current slug. If you found something, use get_permalink() for the result and wp_redirect() … Read more

Change order of posts

Your question is not very detailed. It is hard to work out exactly what you are doing but I am assuming that you are trying to sort posts by a custom meta meta_key/meta_value. This the formula for that (annotated but basically lifted from the Codex): $args = array( ‘post_type’ => ‘your_post_type’, // I don’t know … Read more