diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index 4f6153a87cfd5b2810569ef5a7e1452707029fe8..f98e5052167fa6f0a61d34f1350db9234fee3c89 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -145,20 +145,12 @@ module Homebrew
     formula_spec = formula.stable
     odie "#{formula}: no #{requested_spec} specification found!" unless formula_spec
 
+    old_mirrors = formula_spec.mirrors
     new_mirrors ||= args.mirror
     new_mirror ||= determine_mirror(new_url)
     new_mirrors ||= [new_mirror] unless new_mirror.nil?
 
-    if !new_mirrors && !formula_spec.mirrors.empty?
-      if args.force?
-        opoo "#{formula}: Removing all mirrors because a --mirror= argument was not specified."
-      else
-        odie <<~EOS
-          #{formula}: a --mirror= argument for updating the mirror URL was not specified.
-          Use --force to remove all mirrors.
-        EOS
-      end
-    end
+    check_for_mirrors(formula, old_mirrors, new_mirrors, args: args) if new_url
 
     hash_type, old_hash = if (checksum = formula_spec.checksum)
       [checksum.hash_type, checksum.hexdigest]
@@ -196,7 +188,14 @@ module Homebrew
       odie "#{formula}: no --url= or --version= argument specified!"
     else
       new_url ||= PyPI.update_pypi_url(old_url, new_version)
-      new_url ||= old_url.gsub(old_version, new_version)
+      unless new_url
+        new_url = old_url.gsub(old_version, new_version)
+        if !new_mirrors && !old_mirrors.empty?
+          new_mirrors = old_mirrors.map do |old_mirror|
+            old_mirror.gsub(old_version, new_version)
+          end
+        end
+      end
       if new_url == old_url
         odie <<~EOS
           You need to bump this formula manually since the new URL
@@ -389,6 +388,19 @@ module Homebrew
     end
   end
 
+  def check_for_mirrors(formula, old_mirrors, new_mirrors, args:)
+    return if new_mirrors || old_mirrors.empty?
+
+    if args.force?
+      opoo "#{formula}: Removing all mirrors because a --mirror= argument was not specified."
+    else
+      odie <<~EOS
+        #{formula}: a --mirror= argument for updating the mirror URL(s) was not specified.
+        Use --force to remove all mirrors.
+      EOS
+    end
+  end
+
   def fetch_resource(formula, new_version, url, **specs)
     resource = Resource.new
     resource.url(url, specs)