• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Logo

CITROWEB

First choice for your online presence

  • home page
  • Services
    • Web design, web development and consulting
    • Online stores with WooCommerce
    • Technical support for WooCommerce stores
    • Search engine marketing
      • SEO: Your website receives more relevant visitors
      • SEA: Search engine advertising for your website
    • Web hosting packages and domains
  • Blog
  • Contact us

Blog

Remove “Thank you for your trust in WordPress” from the bottom of the dashboard

12. August 2022

The following code can be used to remove the text from the dashboard:

function cwhf_remove_wp_footer_dashboard() 
{
    echo '';
}
add_filter('admin_footer_text', 'cwhf_remove_wp_footer_dashboard')

Instead of an empty text, you can also set your own text here.

Remove WordPress version from the bottom of the dashboard

Filed Under: development, WordPress

Remove WordPress logo from toolbar

9. August 2022

By default, WordPress displays its own logo in the top left corner of the toolbar (so-called adminbar). If you want to remove it, you can do so either with the plugin Remove WP Branding or programmatically in this way:

function cwhf_remove_logo_wp_toolbar() {
        global $wp_admin_bar;
        $wp_admin_bar->remove_menu( 'wp-logo' );
}
add_action( 'wp_before_admin_bar_render', 'cwhf_remove_logo_wp_toolbar', 0 );

Change WordPress logo in toolbar

If you want to display a different logo instead, use the following code:

function cwhf_replace_logo_in_admin_bar() {
echo '
<style type="text/css">
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
background-image: url("https://my-domain.com/wp-content/uploads/my-favicon.png") !important;
background-position: 0 0;
color:rgba(0, 0, 0, 0);
}
#wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon {
background-position: 0 0;
}
</style>
';
}
add_action('wp_before_admin_bar_render', 'cwhf_replace_logo_in_admin_bar');

Filed Under: development, WordPress

Change login cookie lifetime in WordPress

19. July 2022

"Stay logged in" at WordPress login

If you check “Stay logged in” when you log in (see image), WordPress will allow you to work longer in the WordPress backend without having to log in again.

If this checkmark is set, the lifetime of the authentication cookie is increased. However, the time is only extended by about half a month. If you want to stay logged in longer, for example because you want to work with WordPress every day, the following solution is available:

add_filter( 'auth_cookie_expiration', 'cwhf_extend_auth_cookie_to_1_year' );
function cwhf_extend_auth_cookie_to_1_year( $expirein ) {
	return 31556926; // 1 year in seconds
}

The above code must be added to the WordPress code. This is done via the Code Snippets plugin, the functions.php or a

Filed Under: development, WordPress

WordPress multisite and cookie settings in wp-config.php

9. July 2022

Error Image: I created a new site in my multisite environment and replaced the subdomain address for that site with its own domain. The domain records are configured correctly, but still I can’t log into the dashboard on the new site.

The multisite or network feature of WordPress has been an essential part of the core system since version 3.0. In the past, you had to access the possibilities of Multisite via plugins first, but today this feature is part of the basic framework of WordPress. With the current version, it is possible to run sites with different domains within one installation, without being limited to subdomain solutions and directories.

Important: For a setup with subdomain or individual domains, the constant COOKIE_DOMAIN must be set. Otherwise the main domain of the installation will be entered as cookie domain in ms-default-constants and the login will not work. The browser sends cookies only to the matching domain!

Solution

In the wp-config.php the line define( ‘COOKIE_DOMAIN’, ” ); should be inserted.

To make sure that the login with defined constant is not nevertheless hindered by existing cookies, the salt keys must be regenerated and the old ones replaced with them.

Filed Under: development, WordPress

Update GUIDs in WordPress after domain move

9. July 2022

If you move a WordPress installation with the WordPress Toolkit, the GUIDs are not updated. The GUIDs are used by WordPress in the RSS feeds.

If you want to drag the GUIDs, you can do it again with the following SQL command:

UPDATE wp_posts SET guid = REPLACE (guid, 'https://old-domain.com', 'https://new-domain.com');

wp_posts must of course be replaced by the actual table name if you use a cryptic table prefix.

Filed Under: WordPress

Remove header (site-header element) in Genesis

7. June 2022

To remove the header from the page completely from the DOM, you need the following code:

add_action( 'genesis_title', 'cw_remove_header_right_widget', 9 );
function cw_remove_header_right_widget() {
    remove_action('genesis_header', 'genesis_header_markup_open', 5);
    remove_action('genesis_header', 'genesis_do_header');
    remove_action('genesis_header', 'genesis_header_markup_close', 15);
}

Remove header on home page in Genesis

With the following code, you can remove the header element on the home page:

add_action( 'genesis_title', 'cw_remove_header_right_widget', 9 );
function cw_remove_header_right_widget() {
    if ( is_front_page() ) {
        remove_action('genesis_header', 'genesis_header_markup_open', 5);
        remove_action('genesis_header', 'genesis_do_header');
        remove_action('genesis_header', 'genesis_header_markup_close', 15);
    }
}

Note: The code was tested with the Genesis sample theme. Should work for most Genesis themes though.

Filed Under: development, Genesis Framework

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 6
  • Go to Next Page »

Primary Sidebar

Search

Recent Posts

  • Remove “Thank you for your trust in WordPress” from the bottom of the dashboard
  • Remove WordPress logo from toolbar
  • Change login cookie lifetime in WordPress
  • WordPress multisite and cookie settings in wp-config.php
  • Update GUIDs in WordPress after domain move

Footer

Logo




© 2023 CITROWEB
  • Data protection
  • imprint
  • Deutsch