Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/suleman-elahi/wpbrokencheck
A multi-threaded fast script to check broken links on any WordPress website. Checks all the posts, looks for broken internal and external links and save them in a CSV file.
https://github.com/suleman-elahi/wpbrokencheck
broken-link-finder broken-links pyhon python3 pythonscript wordpress wordpress-api
Last synced: 8 days ago
JSON representation
A multi-threaded fast script to check broken links on any WordPress website. Checks all the posts, looks for broken internal and external links and save them in a CSV file.
- Host: GitHub
- URL: https://github.com/suleman-elahi/wpbrokencheck
- Owner: Suleman-Elahi
- Created: 2022-10-06T11:08:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-16T07:58:40.000Z (6 months ago)
- Last Synced: 2024-05-16T09:03:03.692Z (6 months ago)
- Topics: broken-link-finder, broken-links, pyhon, python3, pythonscript, wordpress, wordpress-api
- Language: Python
- Homepage:
- Size: 40 KB
- Stars: 15
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Update 2024
* Ported script to use `httpx` instead of `requests`. Try that here: [WpBrokenCheckx.py](https://github.com/Suleman-Elahi/WpBrokenCheck/blob/main/WpBrokenCheckx.py)
* This version of the script is 15% faster as well 🥳🚀# WpBrokenCheck
[![HitCount](https://hits.dwyl.com/suleman-elahi/WpBrokenCheck.svg?style=flat)](http://hits.dwyl.com/suleman-elahi/WpBrokenCheck)
![](https://komarev.com/ghpvc/?username=WpBrokenCheck&color=green&label=VIEWS)
This is a simple Python script you can use to find out broken links on a WordPress website. It uses WordPress's API v2 to get all the published posts and scans all the links inside including internal links, external links, attachments, images, etc.
At the end, it saves a CSV file in the current working directory. By default, all the links are stored in the CSV file. Later, you can filter them using Excel or LibreOffice.
## Running:
1. Install Python
2. Install [Poetry](https://python-poetry.org/docs/#installation)
3. Run `poetry install`
4. Run as `poetry run python WpBrokenCheck.py [Domain] [CSV_FileName]`
5. Example: `poetry run python WpBrokenCheck.py example.com example.csv`
**Note** : Only type domain without http:// or https://
**Tip** : If target website has large number of posts then change `max_workers` from 5 to 10 at line 60.
## Linters:
There are the following Python linters:
- black for code formatting
- flake8 code formatting and line brakes (PEP8)
- isort for reordering importsThey are run via pre-commit as you commit the code to the repository. You can also run it manually on all files by:
`pre-commit run --all-files`### To Do:
- Make it filter specific codes.
- Make it run on customized WP sites
- ~~Push binary releases~~PRs and suggestions are welcome :)