• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to use Advanced Find/Replace to delete 10,000 links with different names

Explorer ,
Sep 30, 2021 Sep 30, 2021

Copy link to clipboard

Copied

I have tens of thousands of internal links on my site that I want to delete using the Advanced function of the Find/Replace feature.
Trouble is.... all the links have different names, BUT... they all end in one of six endings... like this:

https://sitename.com/folder01/iuteretrtret-aaaa.html
https://sitename.com/folder08/avgvggvhs-bbbb.html
https://sitename.com/folder23/aggvdsvhd-cccc.html
https://sitename.com/folder63/ajskdgvdsi-dddd.html
https://sitename.com/folder82/ufgfwgggf-eeee.html
https://sitename.com/folder95/ieufiuefeej-ffff.html

Is there a way I can use the Advanced  Find/Replace  function to delete the 10,000 links to files that end in  -aaaa.html   and the 10,000 links to files that end in -bbbb.html   and the 10,000 links to files that end in -cccc.html   and the 10,000 links to files that end in -dddd.html.  I tried various combination in the Find/Replace drop-down menus and only ever succeeded in deleting all links on the pages, not just the six non ending-specific ones mentioned above.

Many thanks in advance.

Views

381

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 01, 2021 Oct 01, 2021

you can use Regex for that purpose...

  • open the search in files option (Ctrl | Cmd) + Shift F
  • use the advanced TAB
  • open the filter , the last icon on the right (resembling a funnel topped by a green check mark)
  • ensure to uncheck everything but the "Use Regular Expression" option
  • search in the entire site, or selected files depending on your need
  • select the TAG a
  • select "using attribute" and define "href" then "=" and as a value use the following expression
    .*[a{4}b{4}c{4}d{4}e{4}f{4}].html
    (starti
...

Votes

Translate

Translate
Community Expert ,
Oct 01, 2021 Oct 01, 2021

Copy link to clipboard

Copied

you can use Regex for that purpose...

  • open the search in files option (Ctrl | Cmd) + Shift F
  • use the advanced TAB
  • open the filter , the last icon on the right (resembling a funnel topped by a green check mark)
  • ensure to uncheck everything but the "Use Regular Expression" option
  • search in the entire site, or selected files depending on your need
  • select the TAG a
  • select "using attribute" and define "href" then "=" and as a value use the following expression
    .*[a{4}b{4}c{4}d{4}e{4}f{4}].html
    (starting with a dot, and ending with a l (from HTML in lower case))
  • as Action, define the clean the tag (sorry I don't know the english expression for that option, I only have a french DW)

 

make sure to have a web site back up... and launch the replace all

 

regex-href-1.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 08, 2021 Oct 08, 2021

Copy link to clipboard

Copied

Thank you - I didn't understand the string of attributes, but I was able to change one or two of your drop-down menus and made the changes I needed to. You saved me weeks of time 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 08, 2021 Oct 08, 2021

Copy link to clipboard

Copied

I'm glad that it helped you. thanks for the feedbacks

have a pleasant day

birnou

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 01, 2021 Oct 01, 2021

Copy link to clipboard

Copied

I think a bigger and more relevant question is why do you have 10,000 absolute links in your site and no backend database with which to manage them? 

 

DW is not the best tool for performing 10,000 find & replace routines.  But links stored inside a server-side MySQL database could be replaced very efficiently with a few lines of SQL code. 

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 08, 2021 Oct 08, 2021

Copy link to clipboard

Copied

I suppose I could have used SQL, if I knew what it was. I have less knowledge about what SQL is than I do about find and replace.  I have somehow amassed a huge site as a hobby with just a rudimentary knowledge of DW and almost no knowledge of html.  Birnou's reply meant I effectively used DW to do my find and replaces. But thank you for trying to help.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 08, 2021 Oct 08, 2021

Copy link to clipboard

Copied

quote

I have somehow amassed a huge site as a hobby...

=============
In that case, it's time to consider the advantages of a dynamic site made with server-side programming and content stored in a database (e.g. MySQL).  Static sites are OK for 10-20 page sites.  Beyond that, it's a burden for everyone.  A dynamic CMS site is way more efficient, easier to manage and less costly to host than a boat load of static HTML files.  Something to think about...

https://www.wpbeginner.com/showcase/best-cms-platforms-compared/

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 08, 2021 Oct 08, 2021

Copy link to clipboard

Copied

@Fluffy Paper Clip , besides the fact that Nancy is directing you to use a cms, which I agree with 100%, I will try to answer you more precisely on the SQL point.

 

SQL (for Structured Query Language) is a language that allows you to interact with a relational database... generally in the open source world one use MySql (now MariaDB) and/or PostGre SQL.


As far as a site is concerned, and in parallel to the use of the database and SQL, it is necessary to use a server language, generally PHP, able to use SQL and to manage these interactions to return pure HTML built in function to the browser.


so instead of manually removing all the *aaaa.html, *bbbb.html, from the static HTML pages, one only need to modify the SQL query by asking it to ignore these types of links in its response, and thus PHP will not generate these links in the HTML page...


a simple modification of the query can thus very easily present different pages without heavy and tedious changes on your part within the pages.


Wordpress recommended by Nancy is a very powerful tool, open source, with a large community of users, which allows you to work with a database and which offers a large number of tools (and especially plug ins) to administer and manage your content.

 

of course it is a management that requires a progressive handling of this kind of tool, it is not Dreamweaver at all, and sometimes it requires to lift the cover and to enter the code (PHP mainly) but it remains a solution much more adapted to large volume sites.

 

it is free, try to install a version, even locally on your machine, and see for yourself what it comes out of it... and if so, don't hesitate to come back and talk about it on this forum... (even if it is dedicated to Dreamweaver, the question was about Dreamweaver)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2021 Oct 09, 2021

Copy link to clipboard

Copied

LATEST

it' pretty old, but it can be helpfull, or you can simply google it too...

https://www.puce-et-media.com/installer-et-configurer-un-serveur-web-en-local/

then

you install wordpress, as if it was online

https://wordpress.org/support/article/how-to-install-wordpress/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 01, 2021 Oct 01, 2021

Copy link to clipboard

Copied

in France we say... I have a million of that thing... to mean that we have a lot of it... maybe the OP expresses the same feeling... well I guess

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 01, 2021 Oct 01, 2021

Copy link to clipboard

Copied

In North America, we do that too. 

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 01, 2021 Oct 01, 2021

Copy link to clipboard

Copied

So this is probably the same feeling for the OP... and digging into many, many, files to extract those numerous, and specific, links to be remove is a painfull task... except when using Regex 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines