How to find broken links of website using command line interface (CLI) (Using wget)

Check the broken links on website using. Try below example command which generate the wget.log it list all the broken links. Download & Install wget Add the installation directory to PATH: C:\Program Files (x86)\GnuWin32\bin Syntax: #Syntax: wget -o wget.log -r -l 10 –spider Usage: #Usage: wget -o wget.log -r -l 10 –spider –no-check-certificate Output: #Output:

Read More »
Code Snippets
Mahesh Waghmare

Check which template loading in WordPress site

Below is the simple function which you can use for debugging the site. It  display the template file path of the current page. Like below image: Add below code snippet into your themes functions.php file.

Read More »

WordPress Rest API query parameters mappings

This array defines mappings between public API query parameters whose values are accepted as-passed, and their internal WP_Query parameter name equivalents (some are the same). Only values which are also present in registered will be set. Below is the list of all the endpoints which have query parameters mapping: wp/v2/comments wp/v2/<post-type> wp/v2/<taxonomy> wp/v2/<term> wp/v2/<users> Check below

Read More »

Update PHP Codesniffer (PHPCS), WordPress Coding Standards (WPCS), PHP Compatibility (WIMG)

Update PHP Codesniffer (PHPCS), WordPress Coding Standards (WPCS), PHP Compatibility (WIMG) Copy below individual or all command(s) to get latest update. composer global require squizlabs/php_codesniffer composer global require wp-coding-standards/wpcs composer global require phpcompatibility/php-compatibility composer global require dealerdirect/phpcodesniffer-composer-installer phpcbf phpcs Update: 26 – March 2019 Getting notice Package wimg/php-compatibility is abandoned, you should avoid using it. Use

Read More »

WordPress Rest API Get specific posts by IDs by using `include` parameter

With the Rest API we get all the posts. But, Sometimes we want to get only specific posts by post ids. WordPress have rest API parameter include which return only requested posts by post ids. Syntax:<post-ids> Example 1:,12 It return only 2 posts whose ids are 11 & 12. Note: By default it return

Read More »

WP CLI Commands Cheat Sheet (Complete List of WP CLI Commands)

WP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installs and much more, without using a web browser. Below is the complete list of WP CLI commands generated with WP CLI Commands Cheat Sheet (Complete List of WP CLI Commands) Cache wp cache add Docs | Git wp cache decr Docs | Git

Read More »

Search post by post meta with rest api.

Use filter rest_{$this->post_type}_query to add the post meta support in WP Rest API. Use below code snippet to add the post meta support for post type Post. Syntax:<meta-key>&meta_value=<meta-value> How to use? E.g. Get posts which post meta already-visited value is true. Code Snippet:

Read More »

Getting curl to output HTTP status code?

A more specific way to print out just the HTTP status code is something along the lines of: Command: curl -s -o /dev/null -w “%{http_code}” Output: 200 E.g.

Read More »
Scroll to Top
%d bloggers like this: