How to remove slug from database

For example: mydomain.com/embed automatically redirecting to homepage although I haven’t set redirection. I want to add a page in my website name embed and for this page URL automatically becoming mydomain.com/embed-2. I checked everything, there is no existing or trash post, page, tags Etc. How to remove that existing embed slug from the database? Thanks

Solutions Collecting From Web of "How to remove slug from database"

I don’t exactly know about the word embed, but by default WordPress reserves & uses these sort of words for internal use. I tried to create a page slug named embed but it wouldn’t work for me either on my localhost or on my live server. Maybe this is reserved for WordPress oEmbed functionality.

How to find and correct unexpected redirects.


Here’s some things you should check:

  1. Check your .htaccess file in the root folder of your WordPress installation. Check for any redirection rules.

  2. Disable any SEO plugins (or specifically: redirection plugins — if
    you use these) you might have installed. And actually you should probably just disable ALL plugins. Clear browser cache and temporary files, and reload the front-end of your website. See if the problem disappears. Enable plugins 1 by 1 until the problem becomes apparent once again. That will help to narrow down the culprit.

  3. Check your theme functions.php file to see if there’s been any
    hard coded redirection added by you or someone else once upon a
    time.
  4. Check the database for old slugs.
  5. Once your website has been loaded on the front-end. View source.
    Check for JavaScript redirects.
  6. Open up Google Chrome (Developer Tools) Click the Network tab.
    Reload your page. Observe the changes.
  7. Search your entire website (files) for contents “wp_redirect“.
    Maybe there’s been a redirect added to one of the files used by your
    theme or a plugin.
  8. Search your entire website (files & database) for contents “base64“.
    Maybe there’s been a sneaky redirect added to one of the files used by your theme or a plugin or inserted into your database somewhere. This is often a sign of a compromised website.

Here’s the query for checking your database for option #4:

SELECT * 
FROM `wp_postmeta` 
WHERE `meta_key` = '_wp_old_slug' 

In the “FROM” line (second line)… Make sure you specify the correct name of your “Post Meta” database table. (Your table prefix may differ — but the default is wp_)

If you wanted to get extra specific with option #4 you could enter the slug which the page is being redirected to.

SELECT *  
FROM `wp_postmeta` 
WHERE `meta_key` = '_wp_old_slug' 
AND `meta_value` LIKE '%slug-to-search-for%'

Option #4 directly answers your question about locating and removing slugs from the database. However, it really could be any number of things… Hope this helps.