Moving WordPress website from one domain to another domain

Sometimes we need to move WordPress website from one domain to another domain, in this tutorial we will explain what are the main steps we have to do before moving WordPress website from one domain to another domain . so let have a look on it steps by step.suppose we move WordPress site from https://www.tutorialshore.com to http://percentagetool.com

Steps 1

Change wp_option table siteurl and home value

WordPress website from one domain to another domain

Step 2

Login to Admin side open Permalink Settings
Settings => Permalink Settings

Click Save Changes

WordPress website from one domain to another domain step2

How to add OTP validation in contact form 7 WordPress plugin

Among the WordPress developers their is always only one option in the case of which form plugin to use, that is contact contact form 7 WordPress plugin. as per the current report their a huge percentage of spam message every website are getting daily from the users, so OTP validation is most suitable solution to block spammers so automatically our question is how to add OTP validation in contact form 7 WordPress plugin

Let see in details

add below code inside admin contact form section see in details below

<div class="pad0 col-12 col-sm-12 col-md-12">[text* telno id:mobileOTP class:inpt_box placeholder "Contact Number"]</div>
<div class="pad0 col-12 col-sm-12 col-md-12">[text* OTP id:mobileOTPField class:inpt_box placeholder "OTP"]</div>
<div class="pad0 col-12 col-sm-12 col-md-12">[text OTPDEMO id:mobileOTPFieldDemo class:inpt_box placeholder "OTP"]</div>

after adding this page we have to work on script

download footer.php from theme folder
add below code top of the page


 <script>
jQuery(document).ready(function(){ 
jQuery("#mobileOTPField").css('display','none'); 
jQuery("#mobileOTPFieldDemo").css('display','none'); 
jQuery("#mobileOTPField_bottom").css('display','none'); 
jQuery("#mobileOTPFieldDemo_bottom").css('display','none'); 
var otp ; 
 jQuery("#mobileOTP").on("blur",function(){
 
 var mobile=jQuery("#mobileOTP").val();
 var name=jQuery("#yourname").val();
 if(mobile!='')
 {
 var otp=Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000;
 jQuery.post("/send_otp.php",
 {
 mobile: mobile,
 name: name,
 otp: otp
 },
 function(data, status){
 console.log("ffffffffff"+data);
 //alert(otp);
 jQuery("#mobileOTPField").css('display','block');
 jQuery("#mobileOTPFieldDemo").val(otp);
 
 } );
 }
});
jQuery("#mobileOTPField").on("click",function(){
jQuery("#mobileOTPField").css('border','0px solid red');
});
jQuery("#mobileOTPField").on("blur",function(){
jQuery("#mobileOTPField").css('border','0px solid red');
 var value_otp=jQuery("#mobileOTPFieldDemo").val();
 var otp=jQuery("#mobileOTPField").val();
 if(value_otp!=otp)
 {
 jQuery("#mobileOTPField").css('border','1px solid red');
jQuery("#mobileOTPField").val(''); 
 }

});
</script>

Finally upload below files(send_otp.php) in root folder

This is main functionality for OTP validation in contact form 7 WordPress plugin

<?php
$mobile_no=$_REQUEST['mobile'];
$name=$_REQUEST['name'];
if($name=='')
{
$name='User'; 
}
$otp=$_REQUEST['otp'];
//$otp=rand(100000, 999999);
$curl = curl_init();
$post_data='<MESSAGE>
 <AUTHKEY>278449AfqSEysssss6tW5cebts7e3c</AUTHKEY>
 <SENDER>TEST API</SENDER>
 <ROUTE>4</ROUTE>
 <CAMPAIGN>TEST API</CAMPAIGN>
 <COUNTRY>TEST Enquiry</COUNTRY>
 <SMS TEXT="Dear '.$name.', %0aPlease use this OTP '.$otp.' to complete your enquiry. %0a%0a-Team TESTOTP" >
 <ADDRESS TO="'.$mobile_no.'"></ADDRESS>
 </SMS>
</MESSAGE>';

curl_setopt_array($curl, array(
 CURLOPT_URL => "https://control.msg91.com/api/postsms.php",
 CURLOPT_RETURNTRANSFER => true,
 CURLOPT_ENCODING => "",
 CURLOPT_MAXREDIRS => 10,
 CURLOPT_TIMEOUT => 30,
 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 CURLOPT_CUSTOMREQUEST => "POST",
 CURLOPT_POSTFIELDS => $post_data,
 CURLOPT_SSL_VERIFYHOST => 0,
 CURLOPT_SSL_VERIFYPEER => 0,
 CURLOPT_HTTPHEADER => array(
 "content-type: application/xml"
 ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

return $otp;
?>

Redirect any subdirectory to another subdirectory using htaccess in wordpress

In our blog sometimes for SEO purpose we need to rename the folder name from one directory to another directory suppose we need to rename my folder name style to trends.we need to redirect all url related to http://www.tutorialshore.com/style/***** to http://www.tutorialshore.com/trends/*****.This can be done by using htaccess redirection .here am going to do in wordpress

RewriteRule ^style/(.*)$ /trends/$1 [R=301,NC,L]
#Here all style folder redirect to trends

Full .htaccess files in wordpress


RewriteEngine On
RewriteRule ^style/(.*)$ /trends/$1 [R=301,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]  


how can I create my own blog?

Creating your own blog is easy as making instant noodles,like maggi packet everything is available in one packet that is called CMS(content management system),by using any of the content management system you can start your own blog in couple of minutes.one of the most famous CMS is WordPress,millions of blogs are already developed using this simple system. Here am going to discuss with how to develop your own blog with WordPress

see steps

1) Buy your own domain name and hosting space from any of the hosting service provider like go daddy,dont forget to compare the pricing

e.g example.com

2) Download WordPress from the site wordpress.org/download/

3) upload downloaded WordPress archive to the hosting space,that you bought from any of the hosting provider .every hosting provider will give cpanel login.you can use those credential to upload file to root folder

create my own blog

4) Unzip uploaded WordPress files and move the files into root folder

5) Using cpanel GO to MySQL database area

go to phpmyadmin

6) create a new MySQL database name and username

 

MySQL databse

7) Open any browser type example.com

8) fill database info and user info

9) create admin username and password move forward

10) Now visit example.com your own website is live now

cheer 🙂