wp pdf file short link problem

While working on this wordpress site, I was adding text links to pdf files.  I used the shortcode.  Problem is, that the pdf file link, when clicked on, opens up a page which then has another link to the file and it also has the site design.  

Here is an example of how I DON'T want the pdf file displayed.  Click on link to view.
http://beta.citizensequalrightsalliance.org/?attachment_id=538

There are over 20 pdf files that do this in an over 200 page website.  The other pdf files use the long code and work good.  By good, I mean the pdf file itself opens up in a new window (without the site design).

Here is how I want the pdf files to display.  Click on link to view.
http://beta.citizensequalrightsalliance.org/wp-content/uploads/2014/12/action_guide.pdf

So, my question is simple but the answer might not be.  Is there a way to do a search or setup some sort of query so that I can search for the pages that use the shortcode pdf links (I know which ones are bad) and have the wp system tell me which pages they are linked on?
nsitedesignsAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Jason C. LevineConnect With a Mentor No oneCommented:
The first step is to identify the shortcodes everywhere.  The second step is figuring out the pattern of the PDF ones to isolate just those.
0
 
Jason C. LevineNo oneCommented:
Do you have direct access to the database?
0
 
nsitedesignsAuthor Commented:
my programmer does.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Jason C. LevineConnect With a Mentor No oneCommented:
So this can be done via MySQL query.  The shortcodes are present exactly as typed in the wp_content table, post_content column.  Your programmer can do an update query using a regular expression to match the PDF shortcode and replacing it with a link.  

The trick will be generating that search/replace query.
0
 
nsitedesignsAuthor Commented:
Won't that also show any shortcodes that also link to pages?  I use the shortcodes for page links and those work great.  Somehow I need to id the shortcodes as ones that go to a pdf file.
0
 
nsitedesignsAuthor Commented:
We have now nearly 300 pages on this site.  Shortcodes are everywhere.  I don't know how we will be able to do what you advise since there is nothing specific about the shortcodes to the handful of links that are bad.  I will give you points anyways just for trying.
0
 
Jason C. LevineNo oneCommented:
if there was no identifiable pattern for the bad shortcodes, then there really isn't any other way to do this than manual search and replaces in the database.
0
 
nsitedesignsAuthor Commented:
thanks.
0
All Courses

From novice to tech pro — start learning today.