Category: Programming

Linux MySQL Commands

SET FOREIGN_KEY_CHECKS = 0;<br>DROP TABLE IF EXISTS <code>table1, table2, table3, …;SET FOREIGN_KEY_CHECKS = 1;</code> Take Backup of Database

Read More

WordPress custom YouTube feed plugin

 The Custom YouTube Feed plugin allows WordPress site owners to display videos from multiple YouTube channels and individual videos in an attractive grid layout. The plugin features pagination, popup video playback, and automatic caching for improved performance. Key Features Multiple Channel Support: Add videos from multiple YouTube channels Individual Video Support: Include specific videos by […]

Read More

Fetch data from Google Sheet and show in HTML using PHP

 This documentation explains how to use the provided PHP code to fetch data from Google Sheets and display it in a custom layout using HTML/CSS. Setup Instructions 1. Get Your Google Sheet ID Open your Google Sheet in a web browser Look at the URL in the address bar – it will look like: https://docs.google.com/spreadsheets/d/BmzaSyBzQ0cRTrbf_vxrB75nh8AoV3BtawPiiCQ/edit#gid=0 […]

Read More

Disable WordPress Comment System Completely

 Here’s a comprehensive function to completely disable the WordPress comment system: <?php // Completely disable WordPress comments and related functionality function disable_comments_system() { // Disable support for comments and trackbacks in post types foreach (get_post_types() as $post_type) { if (post_type_supports($post_type, ‘comments’)) { remove_post_type_support($post_type, ‘comments’); remove_post_type_support($post_type, ‘trackbacks’); } } // Close comments on all existing posts […]

Read More

Block HTtrack or any other web scrapper

 There are several web scrappers tools are available by which your website can be downloaded as static files. The simplest way to block these web scrappers is to add the following blocking bots code in your website .htaccess file. ##Block bad bots RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR] RewriteCond %{HTTP_USER_AGENT} ^Bot mailto:[email protected] [OR] RewriteCond %{HTTP_USER_AGENT} […]

Read More

WordPress change default from name and email id

 When you get any email from your self hosted WordPress website, form name of that email will be WordPress which is quite annoying to you or your clients. You can overwrite this by adding this small piece of code in the functions.php file of your theme. function custom_wp_mail_from_name($email_from_name) { return ‘Your Website Name’; // Change […]

Read More