<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Harit Panchal on Medium]]></title>
        <description><![CDATA[Stories by Harit Panchal on Medium]]></description>
        <link>https://medium.com/@panchalharit?source=rss-f1940e809a70------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*K-_RDIAYHzslO7kqfH60Rg.jpeg</url>
            <title>Stories by Harit Panchal on Medium</title>
            <link>https://medium.com/@panchalharit?source=rss-f1940e809a70------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:22:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@panchalharit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hands-on: WordPress MCP (Connecting AI to WordPress )]]></title>
            <link>https://panchalharit.medium.com/hands-on-wordpress-mcp-connecting-ai-to-wordpress-e913db0cb576?source=rss-f1940e809a70------2</link>
            <guid isPermaLink="false">https://medium.com/p/e913db0cb576</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[mcps]]></category>
            <dc:creator><![CDATA[Harit Panchal]]></dc:creator>
            <pubDate>Mon, 20 Apr 2026 05:10:32 GMT</pubDate>
            <atom:updated>2026-04-20T05:10:32.539Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2drl0qyEdrijnMvlFZWkg.png" /></figure><p>What if you could ask an AI to fetch posts, update content, or analyze your WordPress site — without writing custom APIs?</p><p>That’s exactly what <strong>WordPress MCP</strong> enables.</p><p>In this hands-on guide, I’ll walk you through setting up WordPress MCP, connecting it to AI tools, and sharing what actually works (and what doesn’t yet).</p><h3>🚀 Why WordPress MCP is a Big Deal</h3><ul><li>No custom integrations needed</li><li>Standardized AI communication layer</li><li>Turns WordPress into an <strong>AI-ready system</strong></li></ul><p>This matches how MCP acts as a “universal translator” between WP and AI tools</p><h3>🤖 What is WordPress MCP?</h3><p>WordPress MCP (Model Context Protocol) is an experimental project that allows AI tools to interact with your WordPress site in a structured way.</p><p>Instead of copy-pasting prompts or manually integrating APIs, MCP enables:</p><ul><li>Direct communication between AI tools and WordPress</li><li>Smarter automation (content, SEO, dev workflows)</li><li>AI-assisted development inside tools like Cursor or Claude</li></ul><p>👉 Think of it as a bridge between WordPress and AI.</p><h3>⚙️ Prerequisites</h3><p>Before getting started, make sure you have:</p><ul><li>WordPress <strong>7.1 (beta)</strong></li><li><a href="https://wordpress.org/plugins/wordpress-beta-tester/">WordPress Beta Tester</a> plugin installed</li></ul><p><strong>API keys for(ANY ONE) :</strong></p><ul><li><em>Anthropic (Claude)</em></li><li><em>OpenAI (ChatGPT)</em></li><li><em>Google (Gemini)</em></li></ul><p><strong>Basic knowledge of:</strong></p><ul><li><em>Composer</em></li><li><em>Node.js / npm</em></li></ul><h3>📦 Step 1: Install WordPress 7.1 Beta</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B0RXQU83j4rqxfkOvrQZWA.png" /></figure><p>Since MCP is not supported in stable WordPress yet:</p><ol><li>Install the <strong>WordPress Beta Tester</strong> plugin</li><li>Enable beta updates as shown in image.</li><li>Update your site to <strong>WordPress 7.1</strong></li></ol><h3>🧩 Step 2: Clone the WordPress MCP Plugin</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ixDrKMVWBAayPeU12tdWA.jpeg" /></figure><p>The plugin is currently in development:</p><p>👉 <a href="https://github.com/wordpress/mcp-adapter">https://github.com/wordpress/mcp-adapter</a></p><p>Clone it into your plugins directory:</p><pre>git clone https://github.com/wordpress/mcp-adapter<br>cd mcp-adapter</pre><h3>🛠️ Step 3: Install Dependencies</h3><p>Navigate into the plugin folder and run:</p><pre>composer install</pre><ul><li>Activate the plugin</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*Ufi58TIVMp7YAxlh0iCIGA.png" /></figure><h3>🧠 Step 4: Connect with AI Tools</h3><p>You can now connect MCP with tools like:</p><ul><li>Claude</li><li>Cursor</li><li>Other MCP-compatible clients</li></ul><p>This enables:</p><ul><li>AI interacting with your WP content</li><li>AI-assisted development workflows</li><li>Automation across your site</li></ul><p><em>Note: I have used applications password as authentication.</em></p><h4>For Cursor</h4><p>Add below code in <strong>mcp.json</strong> file. Replace your details.</p><pre>{<br> &quot;mcpServers&quot;: {<br>   &quot;wordpress-http-default&quot;: {<br>  &quot;command&quot;: &quot;npx&quot;,<br>  &quot;args&quot;: [<br>    &quot;-y&quot;,<br>    &quot;@automattic/mcp-wordpress-remote@latest&quot;<br>  ],<br>  &quot;env&quot;: {<br>    &quot;WP_API_URL&quot;: &quot;http://wordpress-ai.local/wp-json/mcp/mcp-adapter-default-server&quot;,<br>    &quot;LOG_FILE&quot;: &quot;/Users/your-name/Desktop/logs/mcp-adapter.log&quot;,<br>    &quot;WP_API_USERNAME&quot;: &quot;admin&quot;,<br>    &quot;WP_API_PASSWORD&quot;: &quot;mxW9 CAmp JM0F vzzQ zU54 lH9e&quot;<br>  }<br>   }<br> }<br>}</pre><p>Now in Tools &amp; MCPs you can see enabled tools and prompts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rDQVfmrT9bVgieuMmrjHPQ.png" /></figure><h4>For Claude</h4><p>Add the same code in <strong>claude_desktop_config.json </strong>file and restart Claude desktop and you will see <em>wordpress-http-default</em> server running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lpO2KF2IW8MDlRsGL7lhfw.png" /></figure><h3>🔓Step 5: Enabling Core Abilities for MCP Access</h3><p>Next, configure abilities according to your needs — you can leverage existing core abilities or build custom ones to extend functionality.</p><pre>add_filter( &#39;wp_register_ability_args&#39;, &#39;myplugin_enable_core_abilities_mcp_access&#39;, 10, 2 );<br><br>function myplugin_enable_core_abilities_mcp_access( array $args, string $ability_name ) {<br>    $core_abilities = array(<br>        &#39;core/get-site-info&#39;,<br>        &#39;core/get-user-info&#39;,<br>        &#39;core/get-environment-info&#39;,<br>        &#39;core/get-post&#39;,<br>    );<br>    if ( in_array( $ability_name, $core_abilities, true ) ) {<br>        if ( ! isset( $args[&#39;meta&#39;] ) || ! is_array( $args[&#39;meta&#39;] ) ) {<br>            $args[&#39;meta&#39;] = array();<br>        }<br>        if ( ! isset( $args[&#39;meta&#39;][&#39;mcp&#39;] ) || ! is_array( $args[&#39;meta&#39;][&#39;mcp&#39;] ) ) {<br>            $args[&#39;meta&#39;][&#39;mcp&#39;] = array();<br>        }<br>        $args[&#39;meta&#39;][&#39;mcp&#39;][&#39;public&#39;] = true;<br>    }<br><br>    return $args;<br>}</pre><p>👉 MCP only exposes abilities that are marked public</p><p>This is critical and backed by docs:</p><p>Abilities need <strong>meta.mcp.public = true</strong> to be accessible</p><p>By default, abilities are NOT accessible via MCP — you must explicitly expose them.</p><h3>⚠️ Important Note</h3><p>Be careful with what you expose:</p><ul><li>Don’t blindly enable all abilities</li><li>Only allow what’s necessary</li><li>Treat this like an API permission layer</li></ul><p>Now we can start writing prompts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RStwA2BSW40H7-QDSCFMRw.png" /><figcaption>Claude Desktop</figcaption></figure><h3>🚀 Why This Changes WordPress Development</h3><ul><li>No need to build custom REST integrations</li><li>AI can directly execute actions in WordPress</li><li>Standard interface across all AI tools</li></ul><h3>💡 What You Can Build with MCP</h3><ul><li>AI-generated blog posts inside WP</li><li>Automated SEO/meta updates</li><li>AI-powered admin assistants</li><li>Cross-tool workflows (WP + external APIs)</li></ul><h3>🧾 Conclusion</h3><p>WordPress MCP is still in its early days, but it already gives a glimpse into what the future of WordPress development could look like — <strong>AI working alongside your site, not outside it</strong>.</p><p>Setting it up today requires a bit of effort — beta versions, manual installs, and explicitly enabling abilities — but that’s expected at this stage. Once configured, though, you start to see the real potential: AI tools interacting directly with your WordPress data, assisting in development, and opening the door to smarter automation.</p><p>The most powerful takeaway is control. With abilities, you decide exactly what AI can access and do, making MCP not just flexible, but also safe when used correctly.</p><p>For now, this is best suited for:</p><ul><li>Developers exploring AI integrations</li><li>Early adopters experimenting with new workflows</li></ul><p>If you’re running production sites, it’s worth keeping an eye on — but not deploying just yet.</p><p>👉 Overall, MCP has the potential to become the standard interface between WordPress and AI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e913db0cb576" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Authentication in WordPress — How to use, decode, and implement on Front-end applications.]]></title>
            <link>https://panchalharit.medium.com/basic-authentication-in-wordpress-how-to-use-decode-and-implement-on-front-end-applications-7b1d87ae7f21?source=rss-f1940e809a70------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b1d87ae7f21</guid>
            <category><![CDATA[basic-authentication]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[application-password]]></category>
            <dc:creator><![CDATA[Harit Panchal]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 07:04:12 GMT</pubDate>
            <atom:updated>2023-03-27T07:04:12.865Z</atom:updated>
            <content:encoded><![CDATA[<h3>Basic Authentication in WordPress —How to use, decode, and implement on Front-end application.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*p-GoWAzeuF-SRGgpeJeQkQ.png" /></figure><p>APIs have become a common approach for modern web and mobile applications and preventing such APIs is a huge factor.</p><p>There are multiple ways to prevent your APIs and some of them are Basic authentication, JWT authentication, Oauth2.0, etc. Among these types, <strong>Basic authentication</strong> is a simple authentication scheme built into the HTTP protocol.</p><p>The user needs to send an HTTP request with the Authorization header which will contain a <strong>Basic</strong> word followed by a space and <strong>base64-encoded string</strong> of username: password.</p><p>For example to send an authorized request with <strong>username: demo</strong> and <strong>password: Admin@123</strong> base64-encoded string will look like this <strong>ZGVtbzpBZG1pbkAxMjM= </strong>and the Authorization header will have this look <strong>Authorization: Basic ZGVtbzpBZG1pbkAxMjM=</strong></p><p><strong>Note</strong>: Because base64 is easily decoded, Basic authentication should only be used together with other security mechanisms such as HTTPS/SSL.</p><p>In this blog, you can find,</p><ol><li>How to use Authentication in WordPress.</li><li>How to send a request with Basic authentication in Postman.</li><li>How to decode authorization tokens in WordPress.</li><li>How to send API requests in React using Basic Authentication.</li></ol><h3>How to use Authentication in WordPress</h3><p>In version 5.6 WordPress introduced a new system for making authenticated requests to various WordPress APIs —<strong> Application Passwords</strong>.</p><p>You can find this section at the end of the <strong>Edit User</strong> screen.</p><p>Application Passwords are 24 characters long, generated using <a href="https://developer.wordpress.org/reference/functions/wp_generate_password/">wp_generate_password()</a> without the use of special characters, so they consist exclusively of upper-case, lower-case, and numeric characters. For the cryptographically curious, that comes to over 142 bits of entropy.</p><p>e.g. abcd EFGH 1234 ijkl MNOP 6789</p><p>This password can be used while calling the API request.</p><h4>Limitation</h4><p>By default, Application Passwords are available to all users on sites served over <strong>SSL/HTTPS</strong>.</p><figure><img alt="http limitation in Application password" src="https://cdn-images-1.medium.com/max/1024/1*7TVI0-dF4kZ5CJZ8m3ffjQ.png" /></figure><h4>Solution</h4><p>However, this can be customized using a filter provided by WordPress,</p><pre>add_filter( &#39;wp_is_application_passwords_available&#39;, &#39;__return_true&#39; );</pre><h4>Create Application Password</h4><p>After adding the above filter, you will be able to create an Application password.</p><figure><img alt="create application password" src="https://cdn-images-1.medium.com/max/1024/1*HGynY9wp-ApsFBkD6DidJw.png" /></figure><p>And that&#39;s it! You can revoke the password at any time from the admin side.</p><h3>How to send a request with Basic authentication in Postman</h3><p>Now that the application password is created, you can use this password in Basic Authentication via any API platform, here I am going to demonstrate this on Postman.</p><p>Follow these steps,</p><ol><li>Open a new tab to create a new API request and paste any default or custom-created WordPress API.</li><li>Navigate to the <strong>Authorization</strong> tab and select <strong>Basic Authentication</strong> in the dropdown menu.</li><li>Add username(WordPress username) and password(Application Password).</li><li>Now in the <strong>Headers</strong> tab, you can see the <strong>Authorization</strong> key with the encoded value(which will be hidden at first and noneditable).</li><li>Finally, hit send button and you will get success response.</li></ol><h4>What if the wrong password is entered?</h4><p>In this scenario, you will get a response like this.</p><pre>{<br>    &quot;code&quot;: &quot;incorrect_password&quot;,<br>    &quot;message&quot;: &quot;The provided password is an invalid application password.&quot;,<br>    &quot;data&quot;: {<br>        &quot;status&quot;: 401<br>    }<br>}</pre><p>So far so good? Let’s move on to another interesting topic.</p><h3>How to decode Authorization token in WordPress</h3><p>Okay, so now we are requesting data from API using Basic authentication but we are not doing anything on the server side.</p><p>To make sure our credentials are correct, we need to decode the <strong>Authorization</strong> token.</p><p>Add the following snippet to your REST API callback function,</p><pre>function rest_api_callback_funtion( WP_REST_Request $request ) {<br> $headers     = $request-&gt;get_headers();<br> $auth_header = $headers[&#39;authorization&#39;][0];<br><br> list($username, $password) = explode( &#39;:&#39;, base64_decode( substr( $auth_header, 6 ) ) );<br><br> $user = wp_authenticate( $username, $password );<br> if ( is_wp_error( $user ) ) {<br>  wp_send_json_error( &#39;Authentication required&#39;, 401 );<br> } else {<br>  wp_send_json_success( &#39;Authentication success&#39;, 200 );<br> }<br>}</pre><p>And done! Your API is secured in all the terms.</p><h3>How to send API requests in React using Basic Authentication</h3><p>Now that our API is secured we can finally use it with any front-end technology by passing the <strong>Authorization</strong> header. I am going to illustrate with React JS here.</p><p>While requesting an API call in React JS file we need to add headers like those shown in the following code snippet.</p><pre>  let base64 = require(&quot;base-64&quot;);<br>  const [response, setResponse] = useState(&quot;&quot;);<br><br>  const username = &quot;username&quot;;<br>  const password = &quot;real mdrid reys deeu ropa 1435&quot;;<br><br>  const requestOptions = {<br>    method: &quot;POST&quot;,<br>    headers: {<br>      Authorization: &quot;Basic &quot; + base64.encode(username + &quot;:&quot; + password),<br>    },<br>  };<br><br>  const getquotes = async () =&gt; {<br>    const fetchdata = await fetch(<br>      `YOUR_API`,<br>      requestOptions //headers are added here<br>    );<br>    const response = await fetchdata.json();<br>    setResponse(response);<br>  };</pre><p>Finally completed!</p><h3>Conclusion</h3><p>So, These were some basic steps to achieve the Basic authentication in WordPress REST API. Alternatively, there are other ways to secure API requests but you will need to install plugins for the same. Since WordPress is providing its own it is more secure. (Don’t forget to use it on HTTPS/SSL though)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b1d87ae7f21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WP CLI: Most Useful Commands]]></title>
            <link>https://panchalharit.medium.com/wp-cli-most-useful-commands-119c1a3520ee?source=rss-f1940e809a70------2</link>
            <guid isPermaLink="false">https://medium.com/p/119c1a3520ee</guid>
            <category><![CDATA[wp-cli]]></category>
            <category><![CDATA[wp-commands]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Harit Panchal]]></dc:creator>
            <pubDate>Fri, 29 Apr 2022 13:49:12 GMT</pubDate>
            <atom:updated>2022-04-29T13:49:12.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="WP CLI Usefull Commands" src="https://cdn-images-1.medium.com/max/1024/1*kxOfCqtE22V5uklOoeO2tw.png" /></figure><p>The terminal is a program that you use to type in commands. It is a text input/output environment and is most admired by developers around the world.</p><p>WordPress also has its command-line interface for many actions you might perform in the WordPress admin using WP-CLI.</p><p>This blog will cover the basics of WP-CLI and the most useful commands you can use to speed up the development process so let&#39;s dive in.</p><h3>What is WP-CLI?</h3><p>WP-CLI is a command-line tool for developers to manage common tasks (and not so common) of a WordPress installation. It can add/remove users, posts, and categories, insert test data, search and replace in the database, reset passwords, help troubleshoot performance issues, and much more!</p><h3>Installing WP-CLI</h3><p>Three steps to install WP-CLI in your system (macOS, Linux, FreeBSD, Cygwin).</p><h4>Step-1</h4><pre><strong>curl -O </strong><a href="https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar"><strong>https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar</strong></a></pre><h4>Step-2</h4><pre><strong>chmod +x wp-cli.phar</strong></pre><h4>Step-3</h4><pre><strong>sudo mv wp-cli.phar /usr/local/bin</strong></pre><h3>WP-CLI Commands</h3><p>And now the main part, <em>commands.</em></p><h4>wp admin</h4><pre>wp admin: This command will open /wp-admin/ in the web browser. Very simple way.</pre><pre>wp admin --url=<a href="http://test.whitepaper.cio.de/">http://test.localhost.en/</a>: With help of  the <strong>—url</strong>  parameter you will be able to open /wp-admin/ for a particular subsite(in this case: <a href="http://test.whitepaper.cio.de/">http://test.localhost.en/</a>)  of the multisite setup.</pre><h4>wp cap</h4><pre>wp cap list (user-role): Lists all capabilities for user role.</pre><pre>wp cap add (user-role) (capability): Add capability to the user role.</pre><pre>wp cap remove (user-role) (capability): Removes capability from the user role.</pre><figure><img alt="wp cap example" src="https://cdn-images-1.medium.com/max/1024/1*WaxgeWI3SEt_-rZsDuZntA.png" /><figcaption>wp role example</figcaption></figure><h4>wp core</h4><pre>wp core download: Downloads the latest version of WordPress core in 2 seconds(based on your internet speed 😬).</pre><pre>wp config create --dbname=auto_dep --dbuser=admin --dbpass=YOUR_PASSWORD: Creates config file in thesetup.</pre><p>(wp-config is a different command but <a href="https://developer.wordpress.org/cli/commands/">documentation </a>shows it before wp core and it’s confusing.)</p><pre>wp core install --url=SITE_URL --title=SITE_TITLE --admin_user=USER_NAME --admin_email=YOUR_EMAIL --admin_password=YOUR_PASSWORD: Installs WP.</pre><pre>wp core multisite-convert: Converts into multisite.</pre><pre>wp core update: Updates core to the latest version.</pre><h4>wp embed</h4><pre>wp embed fetch (URL)<strong>: </strong>Retrieves embed URL for any link</pre><p>(Works for the supported providers in <a href="https://developer.wordpress.org/reference/classes/wp_oembed/">WP oEmbed</a> class like Youtube, Twitter, Dailymotion, Spotify, Amazon, TikTok, Pinterest. Instagram)</p><p><strong>Example:</strong></p><pre>wp embed fetch <a href="https://www.youtube.com/watch?v=ZcOmw4rDCQU">https://www.youtube.com/watch?v=ZcOmw4rDCQU</a><br>Returns iframe for youtube video</pre><pre>&lt;iframe title=”Cristiano Ronaldo Celebration | Loudest Crowd Roar!!” width=”500&quot; height=”281&quot; src=”<a href="https://www.youtube.com/embed/ZcOmw4rDCQU?feature=oembed">https://www.youtube.com/embed/ZcOmw4rDCQU?feature=oembed</a>&quot; frameborder=”0&quot; allow=”accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture” allowfullscreen&gt;&lt;/iframe&gt;</pre><p><a href="https://www.youtube.com/watch?v=ZcOmw4rDCQU?feature=oembed">Cristiano Ronaldo Celebration | Loudest Crowd Roar!!</a></p><h4>wp eval</h4><pre>wp eval (code): Echoes the output in the terminal.</pre><p><strong>Example:</strong></p><pre>wp eval ‘echo rand(1,10);’: Echoes random digit between 1 to 10.</pre><pre>wp eval ‘echo WP_CONTENT_DIR;’: Echoes WP Content Directory</pre><pre>wp eval ‘echo get_template_directory();’: Echoes template directory.</pre><h4>wp help</h4><pre>wp help (command): Get help on a specific command.</pre><p><strong>Example:</strong></p><pre># get help for `core` command<br>wp help core<br><br># get help for `core download` subcommand<br>wp help core download</pre><h4>wp maintenance-mode</h4><pre>wp maintenance-mode activate: Activates maintenance mode.</pre><pre>wp maintenance-mode deactivate: Deactivates maintenance mode.</pre><h4>wp option</h4><pre>wp option list: Gets all options from the site.</pre><pre>wp option add (option-name) foobar: Adds new option(option-name) to the database.</pre><h4>wp<strong> </strong>plugin</h4><pre>wp plugin install (plugin slug): Installs plugin from WP plugin directory.</pre><pre>wp plugin activate (plugin slug) (plugin slug): Activates multiple plugins.</pre><pre>wp plugin search (plugin name): Search the plugin in the WP plugin directory.</pre><figure><img alt="wp plugin example" src="https://cdn-images-1.medium.com/max/1024/1*VRmQ1B0lOrpwtzagenp6HA.png" /><figcaption>wp plugin example</figcaption></figure><h4>wp post</h4><pre>wp post generate --count=10 --post_type=(post-slug): Generates 10 posts in (post-slug) post type.</pre><pre>wp post delete $(wp post list --post_type=(post-slug) --format=ids)--force: Deletes all posts of (post-slug) post type.</pre><pre>wp post update (ids) --post_content=’(any content’): Updates content of multiple posts.</pre><h4>wp scaffold (one of the best)</h4><pre>wp scaffold plugin (plugin slug): Creates starter code for the plugin.</pre><pre>wp scaffold child-theme (child-theme-domain)  — parent_theme=(parent-theme-domain): Create starter code for the child theme.</pre><pre>wp scaffold post-type (post-slug) --label=”(post type label)” --dashicon=”(dashicon)” --theme=(theme-domain): Create starter code for post-type in theme.</pre><h4>wp search-replace</h4><pre>wp search-replace ‘(old-url)&#39; ‘(new-url)&#39; :Finds and replaces old-url with new-url in the database (bit risky).</pre><p>That&#39;s all, these were some of the commands which I find useful for day-to-day development.</p><h3>Create Your Custom WP-CLI Command</h3><p>You can also create your command according to requirements and use it accordingly.</p><p>Here is the code snippet for the same, try it:</p><pre><em><br></em>class WDS_CLI {</pre><pre>      public function hello_world() {</pre><pre>            WP_CLI::line( &#39;Hello World!&#39; );</pre><pre>            $rand = rand(1,2);</pre><pre>            if($rand == 1){</pre><pre>                 WP_CLI::success( &#39;Success!&#39; );</pre><pre>            }</pre><pre>            else{</pre><pre>                 WP_CLI::error( &#39;Error!&#39; );</pre><pre>            }</pre><pre>      }</pre><pre>}</pre><pre>function wds_cli_register_commands() {</pre><pre>      WP_CLI::add_command( &#39;wds&#39;, &#39;WDS_CLI&#39; );</pre><pre>}</pre><pre>add_action( &#39;cli_init&#39;, &#39;wds_cli_register_commands&#39; );<br></pre><h3>Conclusion</h3><p>In short, WP-CLI is the best way to fasten development. WP-CLI is indeed a powerful tool that can be used to manage your WordPress sites through the command line. These commands come with various parameters and subcommands and you can manage your database, take backups, and WordPress multisite. You can do so many things with it🔥.</p><p>Check out more on <a href="https://developer.wordpress.org/cli/commands/">WP-CLI</a>.</p><p><strong>By </strong><a href="https://panchalharit.wordpress.com/"><strong>Harit Panchal</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=119c1a3520ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Headless CMS: Gatsby and WordPress]]></title>
            <link>https://panchalharit.medium.com/headless-cms-gatsby-and-wordpress-1e7e91321e39?source=rss-f1940e809a70------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e7e91321e39</guid>
            <category><![CDATA[gatsby]]></category>
            <category><![CDATA[headless-cms]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[gatsbyjs]]></category>
            <dc:creator><![CDATA[Harit Panchal]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 13:12:13 GMT</pubDate>
            <atom:updated>2021-08-24T13:12:13.430Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*VVj7l8hHI1hhxahfwVrPqA.png" /></figure><p>A <em>headless content management system</em> or <em>headless CMS</em> is a CMS in which the content is separated from its presentation. Content management systems such as WordPress and Drupal store content in a database, and use a collection of HTML-based template files to manage how that content gets presented to visitors.</p><h3>Coupled CMS vs. Headless CMS</h3><p>Most traditional or monolithic content management systems are “coupled,” meaning that the content management application (CMA) and the content delivery application (CDA) come together in a single application.</p><p>A <em>headless content management system</em> or <em>headless CMS</em> is a CMS in which the content is separated from its presentation. Content management systems such as WordPress and Drupal store content in a database, and use a collection of HTML-based template files to manage how that content gets presented to visitors.</p><p>So let’s discuss Headless CMS in detail with WordPress + Gatsby JS integration.</p><h3>WordPress</h3><p>WordPress is a free, open-source website creation platform. It is a content management system (CMS) written in PHP that uses a MySQL database more technically. In non-geek speak, WordPress is the easiest and most powerful blogging and website builder in existence today.</p><h3>Gatsby JS</h3><p>Gatsby is an open-source framework that combines functionality from React, GraphQL, and Webpack into a single tool for building static websites and apps. Owing to the fast performance of the sites it powers, impressive out-of-the-box features like code splitting, and friendly developer experience, Gatsby is fast becoming a staple of modern web development.</p><p>These two works independently and we need a bridge between them, which can be done using GraphQL.</p><h3>GraphQL</h3><p>GraphQL is a query language for your API and a server-side runtime for executing queries using a type system you define for your data. GraphQL isn’t tied to any specific database or storage engine and is instead backed by your existing code and data. GraphQL provides the bridge between the front-end framework and CMS.</p><h3>Requirements</h3><p>First of all, we need a fresh basic WordPress setup. Download it from <a href="https://wordpress.org/latest.zip">here</a>. Complete the basic setup. Then go to the plugins page and add two plugins.</p><ol><li><a href="https://wordpress.org/plugins/wp-gatsby/">WP Gatsby</a></li></ol><p>WPGatsby is a free open-source WordPress plugin that optimizes your WordPress site to work as a data source for <a href="https://www.gatsbyjs.com/docs/how-to/sourcing-data/sourcing-from-wordpress">Gatsby</a>.</p><p>2. <a href="https://wordpress.org/plugins/wp-graphql/">WP GraphQL</a></p><p>WPGraphQL is a free, open-source WordPress plugin that provides an extendable GraphQL schema and API for any WordPress site.</p><p>Activate both plugins.</p><p>3. <a href="https://nodejs.org/en/download/">Node</a> version 10.13.0 or higher</p><p>Open a terminal and install gatsby-cli from <a href="https://www.npmjs.com/">npm</a> globally using the command <strong><em>npm install -g gatsby-cli. </em></strong><em>Now you can use gatsby commands using the keyword gatsby.</em></p><h3>Terminal Steps</h3><p>Now follow these steps for a smooth process for fresh gatsby project installation.</p><ol><li>Hit the command <strong><em>gatsby new</em></strong><br>Following this command gatsby will ask you to name your site and folder name that will be created during installation. Do this accordingly.</li><li>Now gatsby will want you to select CMS to select. Use WordPress here and click enter.</li><li>Then gatsby will want you to select a styling system. You can select any styling about your need or skip this part for now and install it manually later.</li><li>As you see now, there are many additional features that you may want in your gatsby site. Select them as your need and hit enter.</li><li>Now you need to enter graphql endpoint from your WordPress CMS site. You can found it in WordPress setup under the GrapQL page. Find the below image for reference.</li></ol><figure><img alt="GraphQL Endpoint URL" src="https://cdn-images-1.medium.com/max/1024/1*0jgBHWYlnFFXn8bPYNQhTg.png" /><figcaption>WordPress View</figcaption></figure><p>Copy highlighted URL and paste in the terminal and hit enter. It&#39;s done gatsby will install your site according to your selection.</p><p>Once installed enter in your gatsby site folder and run the following command.</p><p><strong><em>gatsby develop</em></strong> or <strong><em>npm run develop</em></strong></p><p>Command will start npm and will return localhost URL <a href="http://localhost:8000/">http://localhost:8000/</a> for front end view and <a href="http://localhost:8000/___graphql">http://localhost:8000/___graphql</a> for graphql schema.</p><figure><img alt="graphql page" src="https://cdn-images-1.medium.com/max/1024/1*wHa_Va_UHfyso0c1L50LRQ.png" /><figcaption>http://localhost:8000/___graphql</figcaption></figure><p>GraphQL page will look like this. You can use it for queries and build dynamic pages and posts according to your need.</p><h3>Conclusion</h3><p>So this was the basic installation/setup of your Headless CMS. You can also install gatsby <a href="https://www.gatsbyjs.com/starters/?">starter packs</a> which come with pre-coded files and different themes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e7e91321e39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Gutenberg Block? How to create Gutenberg Block in WordPress?]]></title>
            <link>https://panchalharit.medium.com/what-is-gutenberg-block-how-to-create-gutenberg-block-in-wordpress-994296253f43?source=rss-f1940e809a70------2</link>
            <guid isPermaLink="false">https://medium.com/p/994296253f43</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[gutenberg-block]]></category>
            <category><![CDATA[wordpress-gutenberg]]></category>
            <category><![CDATA[block-developement]]></category>
            <dc:creator><![CDATA[Harit Panchal]]></dc:creator>
            <pubDate>Mon, 08 Feb 2021 16:46:43 GMT</pubDate>
            <atom:updated>2021-02-08T16:46:43.711Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*Qv0aG-NIQbpKVZ023kURSQ.jpeg" /></figure><p>New to WordPress? Then you’ll have installed the latest version(5.6 till date) and might see the editor like this on any Page or Post. But what is this editor called?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDy0gbR48tleSXJgtwsOEw.png" /><figcaption>Latest Twenty Twentyone Theme</figcaption></figure><h3>What is Gutenberg Block?</h3><p>This is not how <a href="https://wordpress.org/">WordPress</a> was used to be. The editor you see here is Gutenberg Editor and blocks on the left-hand side are used in the page/post to create the same. These are the ready-made blocks that come with WordPress installation but you can create your own blocks too. Gutenberg editor was introduced in <a href="https://wordpress.org/download/releases/">WordPress 5.0</a> back in 2018.</p><h3>Requirements to create Gutenberg Block</h3><ul><li>Basic knowledge of <a href="https://reactjs.org/">React Js</a></li><li><a href="https://nodejs.org/en/">Node.js</a> version <strong>12.0.0+</strong></li><li>npm version <strong>6.9.0+</strong></li></ul><h3>How to create Gutenberg Block?</h3><p>If you are new to Gutenberg development then you know there are not many tutorials available now. Even if you find some courses then it will have different ways for creating Gutenberg block like via WordPress Themes or WordPress Plugins and you might get confused about which way is better to use( like I did).</p><p>So here is the simple and latest way to create such a Gutenberg block.</p><ol><li><em>Go to the plugins directory in your WordPress setup</em></li><li><em>Open your terminal there.</em></li><li><em>Write command </em><strong><em>npx @wordpress/create-block cta-image-overlay-and-text.</em></strong></li><li><em>Wait for some minutes and your own Gutenberg Block will be created automatically.</em></li></ol><h3>Error Handling</h3><p>You might run into an error like <a href="https://stackoverflow.com/questions/34600932/npm-eperm-operation-not-permitted-on-windows"><em>EPERM: operation not permitted on Windows</em></a><em> </em>but no need to worry you just simply need to set cache for npm in the user directory<em>.</em></p><h3>Directory Introduction</h3><p>After successful completion you will see the folder structure shown below in your Gutenberg Block plugin, the <strong>src folder </strong>is where all the code will be written.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*ykYcITAGBLzbrQK4IYcBAg.jpeg" /><figcaption>View inside Gutenberg Plugin</figcaption></figure><p>As shown in the above image, the <strong>src </strong>folder contains 3 Javascript files and 2 SCSS files respectively.</p><ol><li>edit.js: To write Gutenberg logic</li><li>editor.scss: Write SCSS for the editor(Backend)</li><li>index.js: To define attributes for a block</li><li>save.js: Structure for the front en</li><li>style.scss: Write SCSS for the front end</li></ol><h3>Next Steps</h3><p>And at the end, to hard code your first own Gutenberg block, visit WordPress’s official documentation <a href="https://developer.wordpress.org/block-editor/">here</a> and create the amazing reusable blocks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=994296253f43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Different DIVI Blog Layouts Designs]]></title>
            <link>https://panchalharit.medium.com/different-divi-blog-layouts-designs-65e762d23e4b?source=rss-f1940e809a70------2</link>
            <guid isPermaLink="false">https://medium.com/p/65e762d23e4b</guid>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[divi-theme]]></category>
            <category><![CDATA[blog-layout]]></category>
            <category><![CDATA[divi]]></category>
            <dc:creator><![CDATA[Harit Panchal]]></dc:creator>
            <pubDate>Wed, 23 Sep 2020 14:49:46 GMT</pubDate>
            <atom:updated>2021-02-08T16:22:32.161Z</atom:updated>
            <content:encoded><![CDATA[<h3>Different DIVI Blog Layout Designs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*k71kjahio_ZqTjU5INCysA.png" /></figure><p>As you all know DIVI only gives 2 Blog layouts to display your blog posts on the website but if you use those default layouts your website may not look different than others.</p><p>But I know you want your website to look amazing and divergent from others in the manner of blog landing or blog page.</p><p>Here I will show you how to create different designs for your blog page. But for that, you need to have some things first.</p><ol><li>Install Divi Theme on your website.</li><li>Select the Blog module.</li></ol><figure><img alt="Divi Blog Module" src="https://cdn-images-1.medium.com/max/393/1*l73E_bkH3bq11tAqULQupQ.png" /></figure><p>Here we go. Now the main work starts.</p><h3>Layout 1 :</h3><p>In the Divi Blog module change the layout to fullwidth.</p><p>Blog → Design → Layout → Fullwidth</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*KdDU8fjSw00iolS3pSY_6A.png" /></figure><p>Now in your Divi Section which contains a blog add 2 Classes “<strong><em>pixie_freebie_posts pixie_freebie_blog</em></strong>”.</p><p>Add CSS that will target the above classes.</p><p><a href="https://github.com/haritpanchal/DVI-Blog-layout-CSS-files/blob/master/Layout%201.css"><strong>Find CSS Here</strong></a></p><p>Now your blog landing page will have a look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2SdJAhct4JxPGlcoBGJIGw.png" /><figcaption><strong>Desktop View</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*LkXBIZ-7FwmUBzNcgbVs5w.png" /><figcaption><strong>Mobile View</strong></figcaption></figure><h3>Layout 2:</h3><p>Just like above change the blog layout to fullwidth.</p><p>Blog → Design → Layout → Fullwidth.</p><p>Now add Class “<strong><em>ds-advent-11</em></strong>” in DIVI Section.</p><p>You will find CSS <a href="https://github.com/haritpanchal/DVI-Blog-layout-CSS-files/blob/master/Layout%202.css"><strong>here</strong></a>, paste this in your child theme’s style.css file.</p><p>Now your blog page will have this amazing timeline view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vMcVaU1vJbGYZrjOzez4Bg.png" /><figcaption><strong>Blog content will appear on mouse hover — Desktop View</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*LspX6_jLbk7-txAhk3uxgQ.png" /><figcaption><strong>Mobile View</strong></figcaption></figure><h3>Layout 3:</h3><p>Just like above change the blog layout to fullwidth.</p><p>Blog → Design → Layout → Fullwidth.</p><p>Assign this class “<strong><em>ds-advent-9</em></strong>” to your blog module.</p><p>Now copy the CSS from <a href="https://github.com/haritpanchal/DVI-Blog-layout-CSS-files/blob/master/Layout%203.css"><strong>here </strong></a>and<strong> </strong>paste this in your child theme’s style.css file.</p><p>Then your Blog page will look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CnPkswaRdSe1gUMrdsNMaQ.png" /><figcaption><strong>On mouse hover READ MORE will appear — Desktop View</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*ZXnVTLSP6XBMGqk3sd9R4A.png" /><figcaption><strong>Mobile View</strong></figcaption></figure><h3>Layout 4:</h3><p>Just like above change the blog layout to fullwidth.</p><p>Blog → Design → Layout → Fullwidth.</p><p>Assign this class “<strong><em>bbb_blog_list</em></strong>” to your blog module.</p><p>Now get CSS from <a href="https://github.com/haritpanchal/DVI-Blog-layout-CSS-files/blob/master/Layout%204.css"><strong>here </strong></a>and<strong> </strong>paste this in your child theme’s style.css file.</p><p>After this, your blog page will have this look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v4aevfuQliUd2PsucdrhKA.png" /><figcaption><strong>Button color will change on hover — Desktop View</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*kpLH0QDte98bbsx7UZ_gdg.png" /><figcaption><strong>Mobile View</strong></figcaption></figure><h3>Conclusion :</h3><p>As you can see it is a very easy task and in no time your Website will have an amazing blog landing layout and will be unique from other sites.</p><p>Also, you can make CSS changes like blog color palette, width, font-size, and many more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65e762d23e4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>