mysql -umyUserName -paVeryStrongPassword
use myWordpressDB;
INSERT INTO `wp_users`(
`user_login`,
`user_pass`,
`user_nicename`,
`user_email`,
`user_status`
)
VALUES(
'admin999',
MD5('password999'),
'firstname lastname',
'email@example.com',
'0'
);
INSERT INTO `wp_usermeta`(
`umeta_id`,
`user_id`,
`meta_key`,
`meta_value`
)
VALUES(
NULL,
(
SELECT
MAX(id)
FROM
wp_users
),
'wp_capabilities',
'a:1:{s:13:"administrator";s:1:"1";}'
);
INSERT INTO `wp_usermeta`(
`umeta_id`,
`user_id`,
`meta_key`,
`meta_value`
)
VALUES(
NULL,
(
SELECT
MAX(id)
FROM
wp_users
),
'wp_user_level',
'10'
);
Copy cPanel to cPanel internal server Migration
cp /home/Source-cPanel-username/public_html/wp-content/ai1wm-backups/your-backup-file-name.wpress /home/Target-cPanel-username/public_html/wp-content/ai1wm-backups
Copy cPanel to cPanel Different server Migration
1. cd /home/Target-cPanel-username/public_html/wp-content/ai1wm-backups
2. wget use-source-url-https-link
Query-1:
UPDATE
wp_wc_product_meta_lookup
SET
min_price =(min_price - min_price * .13)
WHERE 1;
Query-2;
UPDATE
wp_wc_product_meta_lookup
SET
max_price =(max_price - max_price * .13)
WHERE 1;
phpMyAdmin
portal{prefix}_posts
and run the SQL statement as shown.DELETE relations.*, taxes.*, terms.*
FROM metro4u_term_relationships AS relations
INNER JOIN metro4u_term_taxonomy AS taxes
ON relations.term_taxonomy_id=taxes.term_taxonomy_id
INNER JOIN metro4u_terms AS terms
ON taxes.term_id=terms.term_id
WHERE object_id IN (SELECT ID FROM metro4u_posts WHERE post_type IN ('product','product_variation'));
DELETE FROM metro4u_postmeta WHERE post_id IN (SELECT ID FROM metro4u_posts WHERE post_type IN ('product','product_variation'));
DELETE FROM metro4u_posts WHERE post_type IN ('product','product_variation');
Note: "metro4u" is a prefix. Set your Database Table prefix
//enable upload for webp image files.
function webp_upload_mimes($existing_mimes) {
$existing_mimes['webp'] = 'image/webp';
return $existing_mimes;
}
add_filter('mime_types', 'webp_upload_mimes');
//enable preview / thumbnail for webp image files.
function webp_is_displayable($result, $path) {
if ($result === false) {
$displayable_image_types = array( IMAGETYPE_WEBP );
$info = @getimagesize( $path );
if (empty($info)) {
$result = false;
} elseif (!in_array($info[2], $displayable_image_types)) {
$result = false;
} else {
$result = true;
}
}
return $result;
}
add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);
function webp_upload_mimes($existing_mimes) { $existing_mimes['webp'] = 'image/webp'; return $existing_mimes; } add_filter('mime_types', 'webp_upload_mimes'); //enable preview / thumbnail for webp image files. function webp_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WEBP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result; } add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);
function wpb_admin_account(){
$user = 'sadmin';
$pass = '123456';
$email = 'username@yourdomain.com';
if ( !username_exists( $user ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $user, $pass, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
} }
add_action('init','wpb_admin_account');
mysql -umyUserName -paVeryStrongPassword show databases; use myWordpressDB; SELECT ID, user_login, user_pass FROM wp_users; UPDATE wp_user...