Unable to locate WordPress Root directory

I’m sure there is another way to fix it, but you could always try to do a fresh install. Make sure you backup your database and theme files, of course, and then just drop them into the new install. Not the most eloquent solution, but it has worked for me in the past when I … Read more

Redirect loop in /wp-admin/

Try renaming the plugins folder to e.g. plugins-, so as to make sure it has nothing to do with them. Switch it back if it’s not the case. If it was, proceed to do similar steps with each individual plugin folder until you locate the culprit. The same for themes if you’re still out of … Read more

How to set admin login page as home page

This plugin will do exactly that: Members Only. Don’t worry about the warning at the top about not being updated in over 2 years, I use the plugin all the time, there are no issues with it and no security flaws that I have run into. After you install the plugin, there is a small … Read more

Add custom list menu on Posts page in admin panel

You can use the views_{$this->screen->id} filter in WP_List_Table::views(), where screen ID in this case is edit-post: function wpse_177655_views( $views ) { $custom = sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/177655/%s”‘, esc_url( ‘edit.php?post_type=post&custom=foobar’ ) ); if ( ! empty( $_GET[‘custom’] ) && $_GET[‘custom’] == ‘foobar’ ) $custom .= ‘ class=”current”‘; $custom .= ‘>Custom</a>’; $views[‘custom’] = $custom; return $views; } add_filter( … Read more

Clicking On View Post In Draft Opens New Tab

You can hack by adding below lines in your theme’s functions.php file. function remove_preview_target() { // below JS code will set Preview button’s **target** attribute to **_self**, it means same tab/window. echo “<script> jQuery(document).ready(function(){ jQuery(‘#post-preview’).attr(‘target’, ‘_self’); }) </script>”; } // this action performs in admit footer add_action(‘admin_footer’, ‘remove_preview_target’); Or add below lines in your JS … Read more

sort tags by tag ID in admin panel

Use orderby=id You can simply sort the tags by term_id with the following GET request: /wp-admin/edit-tags.php?taxonomy=post_tag&orderby=id&order=desc and similar for other taxonomies. Why does this work? The orderby parameter is read through: if ( !empty( $_REQUEST[‘orderby’] ) ) $args[‘orderby’] = trim( wp_unslash( $_REQUEST[‘orderby’] ) ); in the WP_Terms_List_Table class and used as input argument in: get_terms( … Read more

How do I host WordPress on a hidden domain through a reverse proxy?

To ensure your content isn’t crawled from the hidden admin DOMAIN you could include something like this in your .htaccess file. RewriteEngine On #Force traffic to production URL RewriteCond %{HTTP_HOST} !xxxx.com$ [NC] RewriteRule (.*) http://www.xxxx.com/guides/%{REQEUST_URI} [R=301,L] There is more than one way to handle this first redirect so your code may work too (didn’t test … Read more