---json
{
"canonical": ":broken:link",
"description": "This page will show you how to monitor the list of broken links for your ComboStrap website",
"page_id": "1s427m6x9gndvb7rvy0ex",
"title": "A broken link is a link that points to a non-existing page or media"
}
---
====== ComboStrap Quality - Broken links ======
===== About =====
A ''broken link'' is a internal link that points to:
* a [[docs:router:404|non-existing page]]
* or a non-existing media (such as an [[docs:content:image|image]])
They hurt your [[docs:seo:seo|SEO]] and should be avoided at all cost.
You can [[dynamic_monitoring|monitor them]] and you can even [[#list|list them]]
===== List =====
==== Cli ====
You can use the [[:docs:admin:cli|cli command]] called ''broken-link'' to list them
Example
* on the server
./bin/plugin.php combo broken-links
* in [[:docs:admin:docker|dokuwiki docker]] with the combostrap site.
docker exec -it site-com-combostrap php ./bin/plugin.php combo broken-links
==== Sql ====
You can [[docs:analytics:query|query the database]] against the [[docs:analytics:statistics|page statistics data]] with the below Analytics SQL to list the page with broken links and their count along with the [[docs:page:system:path|path of the page]]
with validPages as (select path, analytics
from pages
where json_valid(analytics) = 1)
select path,
json_extract(analytics, '$.statistics.internal_broken_link_count') as broken_link,
json_extract(analytics, '$.statistics.media.internal_broken_count') as broken_media
from validPages
where json_extract(analytics, '$.statistics.internal_broken_link_count') is not null
or json_extract(analytics, '$.statistics.media.internal_broken_count') != 0