Find Site ID From WP_Post

No, post objects do not store this data. You need to store the site ID separately. Post objects do not store the site they were created on or are currently hosted on. That information doesn’t exist in the posts table, nor does WordPress track it elsewhere. The assumption is always that the post comes from … Read more

how can i display my posts alphabetically?

Add both orderby and order query parameters. Here is an excerpt of the PHP code you need: $query_args = array( “category_name” => “elektrotechniek”, “orderby” => “post_title”, “order” => “ASC” ); Use post_title in case you need to order your posts by title, or post_namein case you prefer to order your posts by slug. Any other … Read more

Delete post revisions only for a single post

If you need an SQL query, then this option should be suitable function src_flush_revisions () { global $wpdb; $post_id = 5//exp post id if ( isset( $timeLimit ) ) { $revision_ids = $wpdb->get_col( $wpdb->prepare( “SELECT `ID` FROM $wpdb->posts WHERE `post_type` = ‘revision’ AND `post_parent` = %d”, $post_id ) ); foreach ( $revision_ids as $revision_id ) … Read more

How can I automatically download all images from all imported posts, place them on my new host, and replace all the links

There are plugins that do this, e.g. Auto Upload Images (found in this article). I haven’t tried it myself to recommend it. You’re migrating from BlogEngine.NET. There is also an old BlogML importer plugin to migrate directly from BlogEngine.NET (which produces BlogML exports), but the copy in the main WordPress directory hasn’t been updated in … Read more