facelessuser: @gir-bot lgtm
diff --git a/docs/src/markdown/about/changelog.md b/docs/src/markdown/about/changelog.md
index aca9a3c7..a495ebb9 100644
--- a/docs/src/markdown/about/changelog.md
+++ b/docs/src/markdown/about/changelog.md
@@ -1,5 +1,11 @@
 # Changelog
 
+## 7.2
+
+- **NEW**: Highlight option `linenums` now defaults to `None` and accepts `None`, `True`, or `False`. `None` is
+  disabled by default, but can be enabled per code block. `True` enables line numbers globally. `False` disables
+  globally and cannot be enabled manually per code block.
+
 ## 7.1
 
 - **NEW**: SuperFences will now allow number ranges in `hl_lines` option. (#878)
diff --git a/docs/src/markdown/extensions/highlight.md b/docs/src/markdown/extensions/highlight.md
index 619601f9..df969b1f 100644
--- a/docs/src/markdown/extensions/highlight.md
+++ b/docs/src/markdown/extensions/highlight.md
@@ -101,7 +101,7 @@ Option                    | Type   | Default               | Description
 `pygments_style`          | string | `#!py3thon 'default'` | Set the Pygments' style to use.  This really only has an effect when used with `noclasses`.
 `noclasses`               | bool   | `#!py3 False`         | This will cause the styles to directly be written to the tag's style attribute instead of requiring a stylesheet.
 `use_pygments`            | bool   | `#!py3 True`          | Controls whether Pygments (if available) is used to style the code, or if the code will just be escaped and prepped for a JavaScript syntax highlighter.
-`linenums`                | bool   | `#!py3 False`         | Enable line numbers globally for *block* code.  This will be ignored for *inline* code.
+`linenums`                | bool   | `#!py3 None`          | Enable line numbers globally for *block* code.  This will be ignored for *inline* code. If set to `#!py3 False` line numbers will be disabled globally and can not be turned on, not even per code block.
 `linenums_special`        | int    | `#!py3 1`             | Globally sets the specified nth lines' gutter with the class "special".  This can be overridden in [SuperFences](./superfences.md) per fence if desired.
 `linenums_style`          | string | `#!py3 'table'`       | Controls the output style when `linenums` are enabled. Supported styles are Pygments default `table` and `inline`, but also supported is the pymdown-extensions `pymdownx-inline` which provides a special inline mode, see [Line Number Styles](#line-number-styles) for more info.
 `linenums_class`          | string | `#!py3 'linenums'`    | Controls the name of the line number class when Pygments is not used.
@@ -114,4 +114,9 @@ Option                    | Type   | Default               | Description
 !!! new "New 7.1"
     `linenums_class` was added in `7.1`.
 
+!!! new "New 7.2"
+    `linenums` now accepts `#!py3 None` as the default for allow line numbers to be enabled per code block.
+    `#!py3 False` now disables line numbers globally preventing line numbers even if specified per code block. `True`
+    still enables globally.
+
 --8<-- "refs.txt"
diff --git a/pymdownx/__meta__.py b/pymdownx/__meta__.py
index 50d4e201..b5f65787 100644
--- a/pymdownx/__meta__.py
+++ b/pymdownx/__meta__.py
@@ -185,5 +185,5 @@ def parse_version(ver, pre=False):
     return Version(major, minor, micro, release, pre, post, dev)
 
 
-__version_info__ = Version(7, 1, 0, "final")
+__version_info__ = Version(7, 2, 0, ".dev")
 __version__ = __version_info__._get_canonical()
diff --git a/pymdownx/highlight.py b/pymdownx/highlight.py
index f61f1694..aff651c4 100644
--- a/pymdownx/highlight.py
+++ b/pymdownx/highlight.py
@@ -65,7 +65,7 @@ DEFAULT_CONFIG = {
         'Default false'
     ],
     'linenums': [
-        False,
+        None,
         'Display line numbers in block code output (not inline) - Default: False'
     ],
     'linenums_style': [
@@ -183,7 +183,7 @@ class Highlight(object):
 
     def __init__(
         self, guess_lang=True, pygments_style='default', use_pygments=True,
-        noclasses=False, extend_pygments_lang=None, linenums=False, linenums_special=-1,
+        noclasses=False, extend_pygments_lang=None, linenums=None, linenums_special=-1,
         linenums_style='table', linenums_class='linenums', wrapcode=True
     ):
         """Initialize."""
@@ -254,12 +254,13 @@ class Highlight(object):
         """Highlight code."""
 
         class_names = classes[:] if classes else []
+        linenums_enabled = (self.linenums or (self.linenums is not False and linestart >= 0)) and not inline > 0
 
         # Convert with Pygments.
         if pygments and self.use_pygments:
             # Setup language lexer.
             lexer = self.get_lexer(src, language)
-            linenums = self.linenums_style if (self.linenums or linestart >= 0) and not inline > 0 else False
+            linenums = self.linenums_style if linenums_enabled else False
 
             if class_names:
                 css_class = ' {}'.format('' if not css_class else css_class)
@@ -311,7 +312,7 @@ class Highlight(object):
         else:
             # Format block code for a JavaScript Syntax Highlighter by specifying language.
             classes = class_names
-            linenums = self.linenums_style if (self.linenums or linestart >= 0) and not inline > 0 else False
+            linenums = self.linenums_style if linenums_enabled else False
             if language:
                 classes.append('language-%s' % language)
             class_str = ''

Disable linenums thoroughly
When using `pymdownx.highlight` and set `linenums` to `False`, users can still enable `linenums` like this:

<pre><code>
```linenums="1"
 code
```
</code></pre>

How can I prevent this?
diff --git a/tests/test_extensions/test_highlight.py b/tests/test_extensions/test_highlight.py
index 137897dc..a8f4e3a3 100644
--- a/tests/test_extensions/test_highlight.py
+++ b/tests/test_extensions/test_highlight.py
@@ -271,3 +271,61 @@ class TestHighlightSpecial(util.MdCase):
             ''',  # noqa: E501
             True
         )
+
+
+class TestDisabledLinenums(util.MdCase):
+    """Test with line numbers globally disabled."""
+
+    extension = ['pymdownx.highlight', 'pymdownx.superfences']
+    extension_configs = {
+        'pymdownx.highlight': {
+            'linenums': False
+        }
+    }
+
+    def test_global_disable(self):
+        """Test with line numbers globally disabled."""
+
+        self.check_markdown(
+                r'''
+                ```python linenums="1"
+                import test
+                test.test()
+                ```
+                ''',
+                r'''
+                <div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">test</span>
+                <span class="n">test</span><span class="o">.</span><span class="n">test</span><span class="p">()</span>
+                </code></pre></div>
+                ''',  # noqa: E501
+                True
+            )
+
+
+class TestDisabledLinenumsNoPygments(util.MdCase):
+    """Test with line numbers globally disabled with no Pygments."""
+
+    extension = ['pymdownx.highlight', 'pymdownx.superfences']
+    extension_configs = {
+        'pymdownx.highlight': {
+            'linenums': False,
+            'use_pygments': False
+        }
+    }
+
+    def test_global_disable(self):
+        """Test with line numbers globally disabled and no Pygments."""
+
+        self.check_markdown(
+                r'''
+                ```python linenums="1"
+                import test
+                test.test()
+                ```
+                ''',
+                r'''
+                <pre class="highlight"><code class="language-python">import test
+                test.test()</code></pre>
+                ''',  # noqa: E501
+                True
+            )

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest coverage tox
3.7
requirements/project.txt requirements/test.txt requirements/docs.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
Babel==2.14.0
beautifulsoup4==4.13.3
bracex==2.3.post1
cachetools==5.5.2
certifi @ file:///croot/certifi_1671487769961/work/certifi
chardet==5.2.0
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
coverage==7.2.7
csscompressor==0.9.5
distlib==0.3.9
exceptiongroup==1.2.2
filelock==3.12.2
ghp-import==2.1.0
gitdb==4.0.12
GitPython==3.1.44
html5lib==1.1
htmlmin2==0.1.13
idna==3.10
importlib-metadata==6.7.0
iniconfig==2.0.0
Jinja2==3.1.6
jsmin==3.0.1
lxml==5.3.1
Markdown==3.4.4
MarkupSafe==2.1.5
mergedeep==1.3.4
mkdocs==1.5.3
mkdocs-git-revision-date-localized-plugin==1.2.2
mkdocs-material==9.2.7
mkdocs-material-extensions==1.2
mkdocs-minify-plugin==0.7.1
packaging==24.0
paginate==0.5.7
pathspec==0.11.2
platformdirs==4.0.0
pluggy==1.2.0
Pygments==2.17.2
-e git+https://github.com/facelessuser/pymdown-extensions.git@759c780c7dbdd580a8d73a7c56dcfd86028ff5a4#egg=pymdown_extensions
pymdown-lexers @ git+https://github.com/facelessuser/pymdown-lexers.git@4cd030ad37bedff37345b37c1f1cd118530429ed
pyproject-api==1.5.3
pyspelling==2.8.2
pytest==7.4.4
pytest-cov==4.1.0
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.1
pyyaml_env_tag==0.1
regex==2022.10.31
requests==2.31.0
six==1.17.0
smmap==5.0.2
soupsieve==2.4.1
tomli==2.0.1
tox==4.8.0
typing_extensions==4.7.1
urllib3==2.0.7
virtualenv==20.26.6
watchdog==3.0.0
wcmatch==8.4.1
webencodings==0.5.1
zipp==3.15.0

name: pymdown-extensions
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - babel==2.14.0
      - beautifulsoup4==4.13.3
      - bracex==2.3.post1
      - cachetools==5.5.2
      - chardet==5.2.0
      - charset-normalizer==3.4.1
      - click==8.1.8
      - colorama==0.4.6
      - coverage==7.2.7
      - csscompressor==0.9.5
      - distlib==0.3.9
      - exceptiongroup==1.2.2
      - filelock==3.12.2
      - ghp-import==2.1.0
      - gitdb==4.0.12
      - gitpython==3.1.44
      - html5lib==1.1
      - htmlmin2==0.1.13
      - idna==3.10
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - jinja2==3.1.6
      - jsmin==3.0.1
      - lxml==5.3.1
      - markdown==3.4.4
      - markupsafe==2.1.5
      - mergedeep==1.3.4
      - mkdocs==1.5.3
      - mkdocs-git-revision-date-localized-plugin==1.2.2
      - mkdocs-material==9.2.7
      - mkdocs-material-extensions==1.2
      - mkdocs-minify-plugin==0.7.1
      - packaging==24.0
      - paginate==0.5.7
      - pathspec==0.11.2
      - platformdirs==4.0.0
      - pluggy==1.2.0
      - pygments==2.17.2
      - pymdown-lexers==1.3.0
      - pyproject-api==1.5.3
      - pyspelling==2.8.2
      - pytest==7.4.4
      - pytest-cov==4.1.0
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.1
      - pyyaml-env-tag==0.1
      - regex==2022.10.31
      - requests==2.31.0
      - six==1.17.0
      - smmap==5.0.2
      - soupsieve==2.4.1
      - tomli==2.0.1
      - tox==4.8.0
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - virtualenv==20.26.6
      - watchdog==3.0.0
      - wcmatch==8.4.1
      - webencodings==0.5.1
      - zipp==3.15.0
prefix: /opt/conda/envs/pymdown-extensions

tests/test_extensions/test_highlight.py::TestDisabledLinenumsNoPygments::test_global_disable
tests/test_extensions/test_highlight.py::TestHighlightInline::test_pymdownx_inline tests/test_extensions/test_highlight.py::TestNoClass::test_no_class tests/test_extensions/test_highlight.py::TestNoClass::test_no_class_and_user_class tests/test_extensions/test_highlight.py::TestNoClass::test_no_class_and_user_class_linenums tests/test_extensions/test_highlight.py::TestNoPygmentsCustomLineClass::test_no_pygments_linenums_custom_class tests/test_extensions/test_highlight.py::TestHighlightSpecial::test_special tests/test_extensions/test_highlight.py::TestHighlightSpecial::test_special_override tests/test_extensions/test_highlight.py::TestDisabledLinenums::test_global_disable
tests/test_extensions/test_highlight.py::TestNoClassNoPygments::test_no_class_no_pygments tests/test_extensions/test_highlight.py::TestNoPygments::test_no_pygments tests/test_extensions/test_highlight.py::TestNoPygments::test_no_pygments_linenums tests/test_extensions/test_highlight.py::TestNoPygmentsCustomLineClass::test_no_pygments_linenums_custom_class_fences
pymdownx/highlight.py pymdownx/__meta__.py docs/src/markdown/about/changelog.md docs/src/markdown/extensions/highlight.md
pymdownx/highlight.py pymdownx/__meta__.py docs/src/markdown/about/changelog.md docs/src/markdown/extensions/highlight.md