• Hi! The Insert/Edit Link list is currently showing published Posts AND Pages and I would like to exclude all Pages from the list so Pages will not be ‘suggested’ (appear) anymore. Does someone know how to do that? Thanks for your help! ??

    • This topic was modified 4 years, 8 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 4 replies - 1 through 4 (of 4 total)
  • Is this from a plugin or theme? What theme or plugin. Can you supply a url to your site? Please provide more information.

    Thread Starter Alkorr

    (@alkorr)

    Hi mrtom414, no plugin, nothing, only a genuine WP install ??

    When you write a post (not using Gutenberg) you can select some text and click on the Insert/Edit Link icon above the text area. If you click on the Link Option gear icon (right) then a list appears with recent published posts you can add as link. I want to exclude recent published pages to appear in this list. There must be some code to add to the functions.php but I don’t know where to start (I don’t code at all…).

    I hope it helps, thanks!

    Thread Starter Alkorr

    (@alkorr)

    Hi, I found this code to exclude pages from WordPress Search, I guess it could work to exclude Pages from the Insert/Edit Link dropdown menu but that’s as far as I can go since I don’t code at all… If this is useful to anyone to help me on that matter. Thank you!

    if (!is_admin()) {
    function nopages_search_filter($query) {
    if ($query->is_search) {
    $query->set('post_type', 'post');
    }
    return $query;
    }
    add_filter('pre_get_posts','nopages_search_filter');
    }
    Thread Starter Alkorr

    (@alkorr)

    I’m sorry to post again but I thought maybe the code I copied in my previous post would help someone find a solution to my problem.

    I searched again through the WP Forums and the web but I couldn’t find any suggestion to solve my problem. I hope someone will read this thread and think of something <:)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Exclude Pages From Insert/Edit Link List’ is closed to new replies.