• Mark elayan

    (@ramielian)


    Hello Everyone.

    I know this was asked a lot, but really there is no certain answer (at least that i found).

    [ Moderator note: moved to Fixing WordPress. ]

    I would love to have a custom post type in a separate DB table, i tried pods plugin but it does not give me what i need because it changes many things that i do not understand.

    Is there a way or even a plugin that you know of that could do this?

    or even just a plugin to enable a custom post type in separate DB table?

    I have 3 custom post types needed to be injected in my DB and each one of it has at least 3000 – 8000 posts for now.

    I do not want to overkill my DB server later on and a smaller DB table means much faster connection and response.

Viewing 1 replies (of 1 total)
  • mdshak

    (@mdshak)

    Hi,
    Please create the custom post type like this way:-

    register_post_type( 'sf_product',
        array(
          'labels' => array(
            'name' => __( 'Products' ),
            'singular_name' => __( 'Product' )
          ),
          'public' => true,
    
          /* Database separation */
         'db_tables' => array(
            'prefix' => '', //by default, value of $table_prefix will be used. If user sets this value to something, it will be used as prefix for both of following tables
            'base_prefix' => '' , //this will control it tables are to be kept sitewide or per blog 
            'posts_name' => 'Swift',
            'postmeta_name' => 'swiftmeta',
          ),
      );

    Thanks
    Mohammad

Viewing 1 replies (of 1 total)
  • The topic ‘Custom post in Separate DB table’ is closed to new replies.