Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9233263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:30:40+00:00 2026-06-18T06:30:40+00:00

We have a site using wordpress and we have discovered that at some point,

  • 0

We have a site using wordpress and we have discovered that at some point, a bad plugin or user error has added double slashes after the siteurl (for example, http://example.site//category1/ or http://example.site/category1//category2/, etc.

This seems to work but it looks like there aren’t quite enough results.

SELECT id, post_content
FROM `wp_posts`
where post_content
regexp '(href="[^"]*[^:]\/\/[^"]*)'
and post_status  in('draft','publish')
order by id asc

Is there a better way to do this? I don’t want it to match on the double slash that comes after the http:, hence the negative match on the :.

Edit: for clarification, I want to find all posts (the body of a wordpress post/page) that have a url hard-coded into the page that has double slashes, but do not match on the double slashes after the http:.

Regexp should match on the following:
http://example.site//category1/ or http://example.site/category1//category2/ or even http://example.site/category1/category2// or example.site/category1//category2/

But should not match on the following:
http://example.site/category1/ or http://example.site/category1/category2/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:30:42+00:00Added an answer on June 18, 2026 at 6:30 am

    Perhaps something like this would work.

    SELECT *
    FROM wp_posts
    WHERE CASE WHEN instr(post_content,'http://') > 0 THEN 
      substring(post_content,7) regexp '\/\/'
    ELSE
      post_content regexp '\/\/'
    END
    

    And here is the SQL Fiddle.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Wordpress for the site and have added a user registration form
I have a multilingual WordPress site using WPML plugin which allows to have separate
I have been asked to convert an entire site that is currently using wordpress
I'm building a Wordpress site using Sencha Touch. I've created a plugin that converts
I have more than 3000 members on a site built using wordpress. I am
I just started out using wordpress as a CMS. On the site I have
I have a site search (using Examine & Razor) that breaks if a space
I have added multiple image upload to my site using HTML api's. I have
I have a ASP.NET MVC site using Membership Provider. I have trouble testing some
My site has php scripts, but I want to start using wordpress and get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.