Change main website site url from http to https - wordpress

I found a similar topic but it didn´t solve my problem. I installed a WordPress Multisite. I changed all the values manually that are described in endless forums and tutorials.
My Website > Network > Website > Edit > Info
--> Here the site url stays with http (See pic)
My Website > Network > Website > Edit > Settings
--> Here the site url and home have been changed to https (See pic)
Why?
I checked my changes endless times. The changes should be all correct and done where they should. Still the main site url stays at http what I don´t understand. I have done the changes regarding to this tutorial and others:
https://wpengine.com/support/how-to-change-a-multi-site-primary-domain/
Also I put in the values
define( 'WP_HOME', 'http://somedomain.com' );
define( 'WP_SITEURL', 'http://somedomain.com' );
just to be sure! It didn´t do anything so I deleted this last part again.
Can u please help me. This is so frustrating.
Picture of the problem

Someone from the German wordpress.org site helped me out with a link form Stack Exchange. So in case someone had the same issue, here is a possible solution that helped me out. That´s his words regarding to this link: https://wordpress.stackexchange.com/a/355888/129212
"Workaround:
1.) Make a backup of the database. No backup, no pity.
2.) In wp-config.php, comment out the code block for multisite with the prefix // in front of each line (do not delete).
Analogous:
// define ('WP_ALLOW_MULTISITE', true);
// define ('MULTISITE', true);
// define ('SUBDOMAIN_INSTALL', true);
// $ base = '/';
// define ('DOMAIN_CURRENT_SITE', 'example.com');
// define ('PATH_CURRENT_SITE', '/');
// define ('SITE_ID_CURRENT_SITE', 1);
// define ('BLOG_ID_CURRENT_SITE', 1);
3.) Login again and change the URL to https://example.com (with your domain) under Settings > General
4.) In the wp-config.php delete in the code block the comment characters // for multisite.
Analogous:
define ('WP_ALLOW_MULTISITE', true);
define ('MULTISITE', true);
define ('SUBDOMAIN_INSTALL', true);
$ base = '/';
define ('DOMAIN_CURRENT_SITE', 'example.com');
define ('PATH_CURRENT_SITE', '/');
define ('SITE_ID_CURRENT_SITE', 1);
define ('BLOG_ID_CURRENT_SITE', 1);
5.) Carry on as if nothing had happened."
He said that it seems that WordPress didn´t consider that the main page / parent page would change in any way. So it is the easiest way to return with the previous steps to a "normal site", change the urls and then "activate" Multisite again.
Hope it helps! See ya!

Related

.htaccess remove double https:// http:// in the link

I'm working on one of a client site, some weird reason, a lot of their link show like this: https://http://yourdomain.com/xxxx
It's fine to click the link when I use the console to see the source and will redirect to https://yourdomain.com but when it's front page(without console open), click the button(link), will open https//yourdomain.com, will be missing ":" or "//"
I tried to find where those content come from, but no luck, I can't not use DB to remove that old "HTTP", because everytime they create new resource will still have https://http://
So I wonder can I use a .htaccess file to detect all those "https://http://" links to direct "https://" only.
Thanks for the help!
I don't think it is practical in .htaccess. However, as a temporary solution until you solve the cause of the problem, you should be able to add code to replace bad links at the point WordPress finally "outputs" the page.
I was going to pen a solution but found I only had to modify code for "final output" already here on stackexchange (itself based on this article )
Try adding the following to your theme's functions.php, or for permanence to your own custom site specific plugin.
function my_linkfix_callback($buffer) {
$buffer = str_replace( 'https://http://' , 'https://' ,$buffer);
return $buffer;
}
function my_linkfix_buffer_start() { ob_start("my_linkfix_callback"); }
function my_linkfix_buffer_end() { ob_end_flush(); }
add_action('after_setup_theme', 'my_linkfix_buffer_start');
add_action('shutdown', 'my_linkfix_buffer_end');
Obviously this is just a temporary solution until you solve the cause of the problem

WP Media Library Grid View not displaying

Found this question: Wordpress: media library grid mode infinite loading
And, more recently:
"Currently I am using Enfold child theme but media grid view is not working. Even if I try to get to the grid from any of other places like selecting the featured image its not working."
From: Wordpress grid media is not working
I am having the exact same problem in WordPress (and also using Enfold). I have renamed my plugins folder to plugins.hold, disabling all plugins. I also set the theme to TwentySixteen. Neither of those things worked. The media library list view works -- only the grid view does not. (But, this is vital, since several elements pull the grid view by default with no chance to switch to the list view. This essentially renders those elements useless, as it is impossible to add an image.)
I realize this is more a WP question than a programming question, but I am hoping someone else has seen this and has a suggestion as to how it can be resolved.
I faced same issue on my wordpress site. After the lot of debugging i fixed my problem step by step.
First add given below code your db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );
Then goto /wp-includes/js/wp-util.js files and find the code $.ajax(
options ) on line number 100(depand your wordpress version) insert given below code into your file
deferred.jqXHR = $.ajax( options ).done( function( response ) {
try {
response = JSON.parse(response);
} catch (Exception) {
response = response;
}
Please check your may be resolved.
if you Removed constant from db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );
Then compress your /wp-includes/js/wp-util.js file code and put your compressed code into /wp-includes/js/wp-util.min.js
*change your own risk if your update your wordpress version changed may be lost.
Solution: Check the admin-ajax.php response, if there are non-json return or invalid json return you should investigate where the extra ajax response come from.
I had similar issue recently, after inspecting admin page the admin-ajax.php response contain non json response. It is because my client adding extra code in function.php that somehow append inline to the admin-ajax.php response
I had this issue recently and after trying all suggestion following worked for me.
Add following function in wp-config.php at top most line. If needed after that
than update permalink once.
ob_start();
For me, this happened after moving my site from an NGINX host to Apache. An old .htaccess file was lurking in the /uploads folder, which blocked access to any file in the uploads folder with a referrer that was not was my site (but, the http version, not the current https version). Because NGINX doesn't read .htaccess, this was now suddenly preventing images from being shown in the media grid.
Strangely, the images were showing in the list view. Also, directly requesting images was fine, presumably because that is done without a referrer.
Check the log error file in the wp-admin directory. If the repeating error is something like this
PHP Warning: ini_set () has been disabled for security reasons in
So, disable the ini_set function in your Cpanel (php selector> options> disable functions)
If the php selector option does not appear in your Cpanel, contact your hosting provider to fix this problem
Adding following code to functions.php of theme folder worked for me
add_action('admin_head', 'my_custom_style');
function my_custom_style()
{
echo '<style>
.media-frame.mode-grid .media-toolbar {
height: 60px !important;
}
</style>';
}

Duplicated permalinks on a wordpress page

First I have www.mywebsite.com/blog/ Which is another wordpress Blog under www.mywebsite.com.
Then I created a page inside www.mywebsite.com which has a url of www.mywebsite.com/blog/.
I want to change the first www.mywebsite.com/blog into www.mywebsite.com/blog2 so It won't confuse me anymore.
After changing the permalinks in the admin panel. I can't access www.mywebsite.com/blog anymore.
Is there any way to access the page of the original www.mywebsite.com/blog2/wp-admin? and view the duplicated page www.mywebsite.com/blog/?
Please comments if my question confuses you.
Thanks.
When moving your site, give the guide to moving wordpress or, in this case better, the guide of changing the wordpress url a glance.
Suppose you changed the URIs where you cannot move the files, but still can access the login page (through a redirection or something) you can recover your installation easily.
wp-login.php can be used to (re-)set the URIs. Find this line:
require( dirname(__FILE__) . '/wp-load.php' );
and insert the following lines below:
//FIXME: do comment/remove these hack lines. (once the database is updated)
update_option('siteurl', 'http://your.domain.name/the/path' );
update_option('home', 'http://your.domain.name/the/path' );
run it (once) and you are done. Test your site to make sure that it works right. If the change involves a new address for your blog, make sure you let people know the new address, and consider adding some redirection instructions in your .htaccess file to guide visitors to the new location. Delete those lines from your wp-login.php.

Wordpress Auto Draft disabling

I am using Wordpress v.3.3.1 With Multisite management on.
I am trying to disable the auto draft function, but it seems that I have tried everythig.
What I have tried:
define('WP_POST_REVISIONS', false);
define('WP_POST_REVISIONS', false);
Didn't work.
I have tried to remove the auto_save lines in post-new.php, post-php. Both in wp-includes and in wp-admin. Didn't work.
I have also tried several plugins, but they won't do it! Any idea why?
I notice that you are asking about disabling Auto-Drafts and NOT Auto-Save.
You cannot disable Auto-save, but you can achieve a similar affect by setting a long interval, for example:
define( 'AUTOSAVE_INTERVAL', 3600 ); // Default is 60
(You'd add it in your WordPress site's wp-config.php file.)
As for Auto-Drafts, you don't want to disable them. They are there for an important reason. Let me grab a quote or two for ya...
Samuel 'Otto' Wood, Tech Ninja at Audrey Capital (Matt Mullenweg's angel investment company), says:
Auto-drafts exist because of the fact that multiple users can create new posts at the same time. If two people enter post-new at roughly the same moment, then have their first autosaves occur nearly simultaneously, then there is a race condition that can cause one of them to get back the wrong post ID, which will cause a post to be overwritten/lost when they then continue editing the post.
The auto-draft creates the post and gets the ID of the new post before the editing screen is displayed, thus preventing two simultaneous authors from accidentally having the same post ID in the data in their browser.
Andrew Ozz, who worked on WordPress' TinyMCE integration, says:
This also makes it possible to upload images before the first draft is saved and they will be properly attached to the new post.
And lastly:
Auto-drafts are automatically deleted after 7 days of going unused. They're self-cleaning, basically. No need to worry about them.
A) Set it in your wp-config.php file. Else it won't work.
define( 'AUTOSAVE_INTERVAL', 3600 ); // autosave 1x per hour
define( 'WP_POST_REVISIONS', false ); // no revisions
define( 'DISABLE_WP_CRON', true );
define( 'EMPTY_TRASH_DAYS', 7 ); // one week
Open wp-config.php located in your WordPress root directory and add following code:
define('WP_POST_REVISIONS', false );
before of require_once ABSPATH . 'wp-settings.php'; or and top of the file.
For guys who use WordPress 5.0+ version with Gutenberg Editor, the below code snippet works to disable auto drafting/saving
/**
* Disables auto saving feature for Gutenberg Editor (set interval by 3600s)
*/
add_filter( 'block_editor_settings', 'rsm0128_block_editor_settings', 10, 2 );
function rsm0128_block_editor_settings( $editor_settings, $post ) {
$editor_settings['autosaveInterval'] = 3600;
return $editor_settings;
}
I think disabling it is not good (for example, when you parallely try to publish 2 posts, then there may be problems). So, instead, of disabling:
Method 1)
disable them slightly (without CORE-modifications), see this answer.
Method 2)
just clean them using this code or good plugin WP Clean Up

how to change the link in the wordpress email with newpassword?

how to change the link in the wordpress email with newpassword?
this information we get when we click on forgot password.
username : admin
password : admin
http://www.example.com/wp-login.php
here i want to change this url "http://www.example.com/wp-login.php" and set my own url... how can i do?
some reference code:
if ( !function_exists('is_user_logged_in') ) :function is_user_logged_in() {
$user = wp_get_current_user();
You can hook into the retrieve_password_message filter
function someFunction($message, $key){
}
add_filter('retrieve_password_message', 'someFunction');
You would then have to use the "someFunction" function to parse the $message variable and change the link.
The message variable contains the entire message. So you could simply trim the message based on the number of characters then tack on your new link...
HTH
(Untested)
Using hooks would be my first thought so that you wouldn't have to edit any core files, however I have used the SB Welcome Email Editor plugin a couple times for this exact reason. Their are a couple plugins like this out their and they are fairly light weight and allow full customization of all Wordpress generated emails.
Try using a plugin such as Theme My Login, which does everything for you.
Editing core wordpress files is never a good idea, when updating wordpress, you'll loose all your work.
You can simply follow steps if you want to edit your code file.
Go to your wordpress folder. Look for the following files:
1. /wp-login.php
2. /includes/functions.php
Change the all the codes which contains wp-login.php into your custom URL.
for example: admin.php or client-login.php
Now you can changed your login/signup URL into your custom URL.
Known issue: You can find some database error if you make any mistakes. Just refresh the page and try with the customized Url it will work...
Example site I used here : http://androideveloper.com/admin.php from http://androideveloper.com/wp-login.php
Cheers.

Resources