The wordpress importer / exporter should work for this task (maintaining post dates and comments), but it’s better to test it before deleting the online blog.
My advice is to create first a fresh install in a folder (so you’ll can temporary reach your new installation at www.yoursite/folder/ ) and test if everything works fine importing post to the new location. Just then you can delete the old blog and move your index.php to the root (for detailed explanation on how handle wordpress installation in a folder refer to https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory ).
This way you can test first the migration and then substitute the old blog with the new one when everything is done.
Related Posts:
- WordPress Multisite – Create Default Post and New Category On New Site Install
- How to backup WP blog posts to computer, not new site
- get backup file from wordpress database in x days
- Post restoration
- Restore posts, but only posts that exist in my database backup
- Get WordPress post content by post id
- Get page ID of page that is set as the posts page
- How to hide specific Gutenberg blocks settings from users
- Display Random Author with Details in Sidebar
- Get old values for post before saving new ones
- Execute function when post is published
- Displaying content of single post
- Help! Turn php link data into url OR hide edit link in post admin OR hide drafts for all users except admin?
- How to load paginated post pages via ajax
- Get the current post ID as a variable in Javascript
- order posts by date like craigslist
- Syntax Highlighter XML striping
- What to use: wp_is_post_autosave( $post_id ) or DOING_AUTOSAVE?
- How to sort posts by last name (2nd word) on ONE category only?
- Manually delete post from database
- Query posts distinct authors
- Why do I need to use The Loop on pages (inside page.php etc)?
- How to get previous 10 days post from a specific date – WP Query
- Load posts dynamically
- Developing a secure front end posting form
- Open WordPress Posts in Bootstrap Modal
- How to remove images from showing in a post with the_content()?
- Automatically added brs and paragraphs?
- Automatically create pages in a post based on number of words
- Divide Post content into separate divs for every 500 characters (or any other character counts)
- Static posts page with home.php
- How to show posts rank based on custom field value
- Display All Sticky Post Before Regular Post
- At my posts archive page, outside the loop, get_the_id() returns the top most post’s ID
- Allowing a user to write a post from another website?
- Delete Post Link to delete post, its meta and attachments
- Change default screen option value for posts per page
- post_exists() in an external script?
- How to display an icon when a new post is published and then remove it when a specific time past?
- prevent showing posts of an specific category in admin posts section
- Repost post on specific date every year
- How to Replace the WordPress Featured Image with a Video?
- How to share same post to multiple site in wordpress?
- Debugging WP routing
- Add custom fields to post programmatically
- How to get Advanced Custom Field Value According using POST ID? [closed]
- Auto set Post to Specific Categories
- New blog template to display only one category
- wp_insert_post question [closed]
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- How to Set Featured image In WordPress without Showing it into Post?
- Filter Posts by Excluding Categories
- publish_post conflicts with save_post
- post_date vs. post_modified – what’s the difference? [closed]
- Invalid post type when click “Filter” or “Apply” button in WordPress admin Post list [closed]
- Adding a cancel button to edit post screen
- Strange problems when I try to insert HTML\XML code snippet in my posts
- How can I list random authors from current post category?
- pagination hook doesn’t work with search results
- Custom excerpt length filter doesn’t work
- Enabling post thumbnails for custom post type
- How do I render all posts of the same category in same layout?
- Tumblr-like Post Types for WordPress
- Custom Blog Post Page
- Contact form 7 post loop [closed]
- WordPress list posts from sub categories
- Disable Jquery UI post tabs
- how can I put an image in a post with original size
- Dynamically generate child-URLs for posts or custom posts
- If Specific Post, Link Elsewhere
- What structure should post_content have in the database?
- Can’t Delete or find a blog post (unknown)
- Comma separated all attached image ID numbers except featured image ID number
- Why orderby=”date” does not support manually changed posts?
- Set terms in a custom post
- Post-ID in url differs from $post->ID
- Child_of not displaying all children posts.. via get_posts
- Format the Layout of Images In The Edit Post Textarea?
- Choose whether to automatically add a taxonomy with the same name as the post
- Which WordPress hook fires after post content loaded?
- How to create a submenu that will navigate through different posts in the same page
- Enable Comments Box On Custom Post Type
- Append class to posts page
- minimum requirement to add posts via database
- Getting the current author (it has changed) of a post, not the original author
- Post body text occupying featured image space before it loads
- Any way for get_next_post() to use the actual post order instead of publish order?
- If in_category not working for multiple single.php pages
- Hightlight unread posts or new posts since last login
- User levels and post visibility
- How to monitor the first publish date?
- Site ‘Categories’: save an admin global setting with post metadata [closed]
- How to get post ID after removing that post?
- I cannot see the pagination in /wp-admin posts page
- Blog Posts Work in Preview, But Are Not Visible on the Live Page – READ MORE u003cspan aria-hidden=’true’u003e→u003c/spanu003e Error
- Twenty Twenty-Four: Static Front Page with Post Links
- Insert Tag in WordPress Post
- WordPress Post page list view seems broken
- /wp-admin/admin-ajax.php Error 500 while using divi premade layout in existing pages
- How to make WP_Query faster when getting a post from one year ago?