3

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

  • 2
    that's the endpoint for oembed. – Milo Dec 28 '16 at 18:24
  • I have no idea, can you please tell me in details? Thanks for your comment. – MOHSINWORLD Dec 28 '16 at 18:27
  • @MOHSINWORLD If your question has been answered, could you please accept the solution. Thanks. – Michael Ecklund Jan 4 '17 at 20:10
2

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.

  • I think so! Maybe nobody can create page with URL mydomain.com/embed they will be automatically set for mydomain.com/embed-2 in WP new version. – MOHSINWORLD Dec 28 '16 at 18:56
  • 1
    Yes. that's for sure.WP core team do these things for some good reason so use an alternative page slug. – Anwer AR Dec 28 '16 at 19:15
  • 1
    add /embed/ to the end of any page or post URL to see what it does. – Milo Dec 28 '16 at 19:44
  • Wow! I got it Mr. Milo. Thank you everyone, I got it fully. – MOHSINWORLD Dec 29 '16 at 2:29
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.