Direct contact

I promise you a rich and beneficial conversation

You'll receive valuable details for your business, guaranteed

Direct contact

I promise you a rich and beneficial conversation

You'll receive valuable details for your business, guaranteed

Show all permalinks in WordPress dashboard

Welcome! I'm delighted to share with you the PHP code below to use on WordPress, hoping it will be helpful in your creative design journey.

My name is Ziad Arman,


I specialize in website design and in helping companies and individuals build a real digital presence.

👉 To easily add the code to your WordPress site, you can use the Code Snippets plugin available at the following link:

🧑‍💻 Function of the Code:


This code displays the Permalinks directly within the WordPress dashboard, making it easier for you to copy links and access them quickly without having to open each page or post individually.

The required PHP code:

// Add a "PermaLink" column to all post types.
function add_permalink_column_to_all_post_types($columns) {
    $columns['permalink'] = 'permalink';
    return $columns;
}

// Show link inside column
function show_permalink_column_for_all_post_types($column, $post_id) {
    if ($column == 'permalink') {
        $permalink = get_permalink($post_id);
        echo '' . esc_url($permalink) . '';
    }
}

// Apply the code to all types of public posts
function apply_permalink_column_to_all_post_types() {
    $post_types = get_post_types(['public' => true], 'names');

    foreach ($post_types as $post_type) {
        add_filter("manage_{$post_type}_posts_columns", 'add_permalink_column_to_all_post_types');
        add_action("manage_{$post_type}_posts_custom_column", 'show_permalink_column_for_all_post_types', 10, 2);
    }
}
add_action('admin_init', 'apply_permalink_column_to_all_post_types');

Simply copy the code and insert it into a new Snippet using the Code Snippets plugin, then activate it across the entire site.

You Can Download Pdf file also 👇