*UPDATE: I reverted the site to a version from a few days ago and it works now. It appears a plug-in auto-updated and broke something. So I disabled auto-update for everything except our security plug-ins. Thank you all for your advice. I’ll leave this up because there are some awesome answers here that someday someone might be able to use too.*
I recently cloned a wordpress site from one webhost to another, attaching it to a different domain. Everything appeared to migrate perfectly including plug-ins, and the new site is live and working as expected.
However, when I’m in the admin interface and try to edit, the theme hangs in perpetuity as it starts to load. When I try to create a new page, it opens the new page but if I save the draft or publish it, I get an error that says, “*Publishing failed.* No route was found matching the URL and request method.”
Any help would be much appreciated. I’m not an IT person so if you do have a suggestion please keep that in mind :).
Edit: When I check my Site Health Status, the following error appears:
**The REST API is one way that WordPress and other applications communicate with the server. For example, the block editor screen relies on the REST API to display and save your posts and pages.**
**When testing the REST API, an unexpected result was returned:**
**REST API Endpoint:** **https://(urlmasked).co/wp-json/wp/v2/types/post?context=edit**
**REST API Response: (403) Forbidden**
How can I fix this?
[ad_2]
The error message “No route was found matching the URL and request method” suggests that there might be an issue with the WordPress permalink settings or the server configuration.
Have tried to check the permalink settings? How about the webhost, is it using the same web server?
Here are some steps you can take to troubleshoot and potentially resolve the issue:
1. **Permalink Settings**: Go to the WordPress admin dashboard, navigate to Settings > Permalinks. Check if the permalink structure is set correctly. Sometimes, simply re-saving the permalink settings can fix routing issues.
2. **.htaccess File**: Ensure that the .htaccess file in the WordPress root directory is correctly configured. WordPress uses this file to handle URL rewriting. You may try renaming it to something like “.htaccess_old” and then re-saving the permalink settings in WordPress. WordPress should generate a new .htaccess file with the correct configuration.
3. **Plugin/Theme Conflict**: Deactivate all plugins and switch to a default WordPress theme (e.g., Twenty Twenty-One). Then, try editing or creating a new page/post. If the issue resolves, reactivate plugins and switch back to your theme one by one until you find the one causing the conflict.
4. **File Permissions**: Ensure that file permissions on the new server are set correctly. WordPress may require certain directories to have specific permissions to function properly. Typically, directories should have permissions set to 755, and files should have permissions set to 644.
5. **Server Configuration**: Check if the new server’s configuration (e.g., Apache or Nginx) supports WordPress’s rewrite rules. Ensure that mod_rewrite is enabled if you’re using Apache.
6. **Database URLs**: Sometimes, after migrating a WordPress site, the old URLs may still be present in the database. You can use a search and replace tool to update all occurrences of the old URL to the new one in the database. Plugins like “Better Search Replace” can help with this task.
7. **Debugging**: Enable WordPress debugging to see if there are any specific error messages or warnings that might provide more insight into the issue. You can enable debugging by adding the following lines to your wp-config.php
​
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );